home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra_2 / xyz101s.zip / XYZ101.DOC < prev   
Text File  |  1995-10-28  |  158KB  |  3,495 lines

  1. ╔═════════════════════════════════════════════════════════════════════╗
  2. ║ System requirements                                                 ║
  3. ╚═════════════════════════════════════════════════════════════════════╝
  4.  To run XYZ you will need to meet the following requirements:
  5.     1. An 80286 or above IBM compatible computer
  6.     2. DOS version 3.3 or above
  7.     3. A minimum 128k of free dos memory
  8. ╔═════════════════════════════════════════════════════════════════════╗
  9. ║ Advantages of XYZ                                                   ║
  10. ╚═════════════════════════════════════════════════════════════════════╝
  11.  1. XYZ is very easy to read and write...no programming degree needed!
  12.  2. XYZ compiles to a very small code size.
  13.  3. XYZ is inexpensive.
  14.  4. XYZ makes fast programs.
  15.  5. The XYZ math functions have a variable number of digits...from 9 
  16.     to 53 digits in length!
  17. ╔═════════════════════════════════════════════════════════════════════╗
  18. ║ Disadvantages of XYZ                                                ║
  19. ╚═════════════════════════════════════════════════════════════════════╝
  20.  1. XYZ is limited to 111 characters per line in the source file.
  21.  2. This version of XYZ is limited to COM files of less than 64k bytes
  22.     in size.
  23.  3. The shareware version of XYZ is limited to 30 lines of code.
  24. ╔═════════════════════════════════════════════════════════════════════╗
  25. ║ Theory behind XYZ                                                   ║
  26. ╚═════════════════════════════════════════════════════════════════════╝
  27.  The purpose behind the  creation of XYZ was  to enable anyone to  sit
  28.  down  and  write  their  own  software  or create their own utilities
  29.  without having to have a degree in programming to do it.  I have seen
  30.  the cryptic code that even  languages as simple as BASIC  and FORTRAN
  31.  have and I thought..."there must be a better way.". 
  32.  
  33.  There is  a revolution  of technology  taking place  in the  computer
  34.  industry  today  but  unfortunately,  there  isn't  a   corresponding
  35.  revolution  taking  place  in  human  nature  as  far  as  quality is
  36.  concerned.  I don't know about  you but I'm tired of being  forced to
  37.  decide  between  the  lesser  of  two  evils  when it comes to buying
  38.  software. I want to help change that.  That is why I decided to  make
  39.  this software compiler  available. Now you  or I can  decide how much
  40.  quality goes into our software and what features we want with it  and
  41.  all we have to do is just spend a little time to write it ourselves.
  42.  
  43.  Please just take a  few moments to look  at this software and  see if
  44.  this is  what you've  been looking  for too.   If you  don't like it,
  45.  that's OK, but please, send me a line and let me know what you  think
  46.  could be done to make it better.
  47.  
  48.  To accomplish my goal of a simple compiler, I designed XYZ with these
  49.  goals in mind:
  50.  
  51.    1. Simple to read and simple to write.
  52.    2. XYZ uses mostly three letter commands. This is because  research
  53.       has shown  that three  letter words  are the  easiest words  for
  54.      people to remember.  By placing all  commands as the  first word
  55.      of each line,  it is also  easier to scan  for certain words  or
  56.      catch mistakes in typing.
  57.    3. XYZ  cannot  use  weird,  hard  to  remember  syntax, symbols or
  58.       reserved arguments.
  59.  
  60.  But no matter how simple programming is made, programming will always
  61.  require a  person to  have strong  logical thinking  abilities.   XYZ
  62.  cannot  teach  you  how  to  think  better  logically, but if you are
  63.  already a  good logical  thinker, it  can help  you put  your logical
  64.  thoughts into computer code easier.  XYZ wasn't made with the thought
  65.  of making programming simpler at  the cost of losing power  over your
  66.  computer  environment  either.  It  has  to  be simple enough for the
  67.  casual   user  as  well  as  powerful  enough  for  the   experienced
  68.  programmer to use.
  69. ╔═════════════════════════════════════════════════════════════════════╗
  70. ║ XYZ License Agreement                                               ║
  71. ╚═════════════════════════════════════════════════════════════════════╝
  72.  XYZ is copyright material owned  by Andrew Robinson and is  protected
  73.  by United States copyright laws and international treaty provisions.
  74.  
  75.  THIS IS A LEGAL AGREEMENT BETWEEN ALL USERS OF ALL VERSIONS OF XYZ:
  76.  
  77.  XYZ is provided as a  shareware program. This entitles one  person on
  78.  one computer  to use  and evaluate  this product  for a  period of 30
  79.  days. Only the shareware version of XYZ is freely distributable.
  80.  
  81.  Should you decide not to register this product, then all source  code
  82.  and/or executable  software/firmware derived  from this  XYZ software
  83.  application product will remain as the legal property of the owner of
  84.  the XYZ software application product.
  85.  
  86.  If you decide to become a registered user, then the owner of the  XYZ
  87.  software  application   product  will   grant  you   a  non-exclusive
  88.  royalty-free  right  to  publish  your  source  code  and  executable
  89.  software PROVIDED that you:
  90.    1. Do  not use  the XYZ  name, logo,  or trademark  to market  your
  91.       software application product.
  92.    2. Agree to indemnify, hold  harmless, and defend the owner  of the
  93.       XYZ software  application product  from and  against any  claims
  94.      or lawsuits  (including attorney's  fees) that  arise or  result
  95.       from  the  use  of  distribution  of  your  software application
  96.      product.
  97.    3. Do not publish any part or whole of the XYZ software application
  98.       product as firmware.
  99.    4. Agree to publish your  name and/or registration number with  the
  100.       source code to your software application product (if the  source
  101.      code is published).   It is your  responsibility to ensure  that
  102.      your name  and/or registration  number remain  intact with  your
  103.      software application product during distribution.
  104.    5. Agree to use only the  registered version of XYZ to derive  your
  105.       software application product.
  106.  
  107.  Registering the  XYZ software  application product  will entitle  one
  108.  person on one computer to use this product per registration.  You may
  109.  not rent or lease the registered XYZ software application product  to
  110.  anyone. You may not transfer  ownership of the registration. You  may
  111.  make  one  copy  of  the  registered XYZ software application product
  112.  solely for the purpose of backup or archiving.
  113.  
  114.  You  may  not  reverse  engineer,  decompile,  disassemble,  or  make
  115.  derivatives of any version of the XYZ software application product.
  116. ╔═════════════════════════════════════════════════════════════════════╗
  117. ║ XYZ Limited Warranty                                                ║
  118. ╚═════════════════════════════════════════════════════════════════════╝
  119.  The unregistered version of  the XYZ software application  product is
  120.  provided "as is", without warranty of any kind.
  121.  
  122.  All warranties (including any implied warranties) for the  registered
  123.  version of the XYZ software  application product are for a  period of
  124.  ninety (90) days from  the date of receipt  of registration.  XYZ  is
  125.  warranted to perform substantially in accordance with the accompanied
  126.  written  or  archived  material  distributed  with  the  XYZ software
  127.  application product.
  128.  
  129.  To  the  maximum  extent  permitted  by  the  law,  the  owner of XYZ
  130.  disclaims  all  other  expressed  or  implied  warranties   including
  131.  warranties  implying  merchanability  and  fitness  for  a particular
  132.  purpose.
  133.  
  134.  To the maximum  extent permitted by  the law, in  no event shall  the
  135.  owner of XYZ be liable for any damages whatsoever (including  without
  136.  limitation, damages  for loss  of business  profits, interruption  of
  137.  business, loss of business information, or any other pecuniary  loss)
  138.  arising out of the use of  or inability to use this product,  even if
  139.  the owner of XYZ has been advised of the possibility of such damages.
  140.  
  141.  Some limitations  discussed here  may not  apply to  you depending on
  142.  your local state or jurisdiction rulings on these matters.
  143. ╔═════════════════════════════════════════════════════════════════════╗
  144. ║ TABLE OF CONTENTS:                                                  ║
  145. ╚═════════════════════════════════════════════════════════════════════╝
  146.  
  147.  CHAPTER TITLE:                                                 LINE#:
  148.  
  149.  System requirements ...........................................0001
  150.  Advantages of XYZ                                              0008
  151.  Disadvantages of XYZ ..........................................0017
  152.  Theory behind XYZ                                              0024
  153.  XYZ License Agreement .........................................0069
  154.  XYZ Limited Warranty                                           0116
  155.  TABLE OF CONTENTS: ............................................0143
  156.  How to compile source files                                    0329
  157.  Definition of ARGUMENT TYPES: .................................0342
  158.    NUMERIC argument types                                       0361
  159.    TEXT argument types .........................................0399
  160.    RESERVED argument types                                      0410
  161.  Description of program commands: ..............................0493
  162.    /// (and adding comments)                                    0504
  163.    --- .........................................................0564
  164.    abs                                                          0583
  165.    acos ........................................................0615
  166.    acosh                                                        0615
  167.    add .........................................................0588
  168.    and                                                          0592
  169.    asin ........................................................0615
  170.    asinh                                                        0615
  171.    atan ........................................................0615
  172.    atanh                                                        0615
  173.    call ........................................................0638
  174.    cmp                                                          0670
  175.    convert .....................................................0730
  176.    cos                                                          0750
  177.    cosh ........................................................0750
  178.    dat                                                          0765
  179.    dec .........................................................0868
  180.    div                                                          0872
  181.    draw ellipse ................................................0877
  182.    draw line                                                    0877
  183.    draw rotated ellipse ........................................0877
  184.    end                                                          0937
  185.    eof .........................................................0946
  186.    exp                                                          0953
  187.    ext .........................................................0958
  188.    file                                                         0990
  189.    find ........................................................1094
  190.    goto                                                         1117
  191.    inc .........................................................1122
  192.    input                                                        1126
  193.    int .........................................................1148
  194.    ior                                                          1175
  195.    jeq .........................................................1197
  196.    jer                                                          1207
  197.    jge .........................................................1217
  198.    jgt                                                          1227
  199.    jle .........................................................1237
  200.    jlt                                                          1247
  201.    jne .........................................................1257
  202.    len                                                          1267
  203.    log .........................................................1274
  204.    mouse                                                        1279
  205.    mul .........................................................1356
  206.    neg                                                          1361
  207.    plot ........................................................1365
  208.    pop                                                          1447
  209.    prn .........................................................1385
  210.    push                                                         1447
  211.    read ........................................................1438
  212.    ret                                                          1463
  213.    save ........................................................1468
  214.    scr                                                          1494
  215.    set .........................................................1510
  216.    sin                                                          0772
  217.    sinh ........................................................0772
  218.    slm                                                          1687
  219.    snd .........................................................1700
  220.    sub                                                          1719
  221.    tan .........................................................0780
  222.    tanh                                                         0780
  223.    tty .........................................................1727
  224.    wait                                                         1736
  225.    xor .........................................................1744
  226.  XYZ COMPILE TIME ERROR MESSAGES:                               1770
  227.  Reporting bugs or giving advice ...............................1801
  228.  Controlling the flow of code                                   1831
  229.  Sample programs to compile ....................................1917
  230.  Becoming a registered user                                     2154
  231.  APPENDIX: .....................................................2183
  232.    Table of key codes:                                          2186
  233.    Table of video modes and their default colors: ..............2229
  234.    Table of ASCII codes:                                        2285
  235.    List of some common DOS 21h interrupts: .....................2332
  236.      Auxiliary Input                                            2335
  237.      Auxiliary Output ..........................................2339
  238.      Character Input with Buffer                                2343
  239.      Character Input without buffer ............................2347
  240.      Character Input with Echo                                  2358
  241.      Character Input without Echo (unfiltered) .................2362
  242.      Character Input without Echo                               2366
  243.      Character Output ..........................................2370
  244.      Character string, Output                                   2374
  245.      Check Input Status ........................................2378
  246.      Create New Program Segment Prefix (PSP)                    2383
  247.      Direct Console I/O ........................................2387
  248.      Disk, Get allocation information about                     2397
  249.      Disk, Get current .........................................2407
  250.      Disk, Get data on                                          2411
  251.      Disk, Read sector from (ignoring logical structure) .......2419
  252.      Disk, Reset                                                2433
  253.      Disk, Select ..............................................2436
  254.      Disk, Write Sector to (ignoring logical structure)         2441
  255.      Duplicate Handle ..........................................2455
  256.      Execute Program                                            2465
  257.      File directory, Create ....................................2475
  258.      File directory, Delete                                     2483
  259.      File directory, Find First File in ........................2491
  260.      File directory, Find Next File in                          2514
  261.      File directory, Get current ...............................2531
  262.      File directory, Set current                                2542
  263.      File, Close ...............................................2550
  264.      File, Commit (forces buffer to be written out)             2558
  265.      File, Create ..............................................2566
  266.      File, Create Temporary                                     2582
  267.      File, Create new ..........................................2598
  268.      File, Delete                                               2614
  269.      File, Extended open, create, or replace ...................2622
  270.      File, Get or Set Attributes of                             2669
  271.      File, Get or Set Date and Time of .........................2685
  272.      File, Lock or unlock region of                             2707
  273.      File, Open ................................................2722
  274.      File, Rename                                               2745
  275.      File, Set Handle Count (sets maximum number of files) .....2754
  276.      File, Set location of pointer in                           2762
  277.      File or Device, Read from .................................2777
  278.      File or Device, Write to                                   2789
  279.      Get Data Transfer Area (DTA) Address ......................2801
  280.      Get Date                                                   2805
  281.      Get Extended Country Information ..........................2812
  282.      Get Extended Error Information                             2827
  283.      Get Interrupt Vector ......................................2870
  284.      Get DOS Version Number                                     2875
  285.      Get Program Segment Prefix (PSP) Address ..................2880
  286.      Get Return Code                                            2884
  287.      Get Time ..................................................2895
  288.      Get Verify Flag                                            2902
  289.      Get address of InDOS Flag .................................2907
  290.      Get or Set Allocation Strategy                             2911
  291.      Get or Set Break Flag .....................................2928
  292.      Get or Set Code Page                                       2935
  293.      Get or Set Country Information ............................2949
  294.      IOCTL (Input/Output Control):                              3001
  295.        Get Device Information ..................................3002
  296.        Change Sharing Retry Count                               3031
  297.        Check Input Status ......................................3040
  298.        Check Output Status                                      3055
  299.        Check if Block Device is Remote .........................3067
  300.        Check if Block Device is Removable                       3078
  301.        Check if Handle is Remote ...............................3087
  302.        Generic I/O Control for Block Devices                    3099
  303.        Generic I/O Control for Character Devices ...............3121
  304.        Get Logical Drive Map                                    3147
  305.        Read Control Data from Block Device Driver ..............3160
  306.        Read Control Data from Character Device Driver           3171
  307.        Set Device Information ..................................3182
  308.        Set Logical Drive Map                                    3200
  309.        Write Control Data to Block Device Driver ...............3213
  310.        Write Control Data to Character Device Driver            3224
  311.      Memory, Allocate Block ....................................3236
  312.      Memory, Release Block                                      3247
  313.      Memory, Resize Block ......................................3255
  314.      Multiplex Interrupt                                        3264
  315.      Printer Output ............................................3273
  316.      Redirect Handle                                            3278
  317.      Set Data Transfer Area (DTA) Address ......................3284
  318.      Set Date                                                   3288
  319.      Set Extended Error Information ............................3296
  320.      Set Interrupt Vector                                       3301
  321.      Set Program Segment Prefix (PSP) Address ..................3306
  322.      Set Time                                                   3310
  323.      Set Verify Flag ...........................................3319
  324.      Terminate Program                                          3322
  325.      Terminate Program with Return Code ........................3326
  326.      Terminate and stay resident (TSR)                          3330
  327.  List of DOS Extended Error Codes ..............................3334
  328.  Using the XYZ Critical Error Handler                           3414
  329. ╔═════════════════════════════════════════════════════════════════════╗
  330. ║ How to compile source files                                         ║
  331. ╚═════════════════════════════════════════════════════════════════════╝
  332.  To compile your source file, you will need to type:
  333.  
  334.    XYZ infile.??? outfile.com
  335.  
  336.  For example (assume your source file is called "example.src"):
  337.  
  338.    XYZ example.src list.com
  339.  
  340.  Would compile  "example.src" and  create an  executable file  from it
  341.  called "example.com".
  342. ╔═════════════════════════════════════════════════════════════════════╗
  343. ║ Definition of ARGUMENT TYPES:                                       ║
  344. ╚═════════════════════════════════════════════════════════════════════╝
  345.  First, let's discuss what exactly  is an argument. Most XYZ  commands
  346.  consist of  a three  letter word  followed by  a space. The arguments
  347.  are  the  variables  that  follow  each  command. For example, if the
  348.  command  is  an  add  instruction,  then  add will be followed by two
  349.  arguments that  will be  added together.   But every  command  cannot
  350.  deal with the same  arguments as every other  command can.  The  data
  351.  stored in a numeric argument is not the same as the data stored in  a
  352.  text argument. The computer can't tell them apart unless you tell  it
  353.  by  defining  your  arguments.  That  is  why we must define argument
  354.  types when programming on computers.  All XYZ argument names can  use
  355.  any letter  or symbol  in their  name except  for a  space (The space
  356.  indicates the  end of  a name).   The maximum  length of  the name is
  357.  thirty  characters.  Once  defined  as  either  a  numeric  or   text
  358.  variable, that same name cannot be  used again.  XYZ has three  basic
  359.  argument types defined for it:  NUMERIC, TEXT, and RESERVED  argument
  360.  types.
  361. ┌─────────────────────────────────────────────────────────────────────┐
  362. │ NUMERIC argument types...                                           │
  363. └─────────────────────────────────────────────────────────────────────┘
  364.  Numeric  argument  types  have  their  number  of  significant digits
  365.  predefined at  the first  line of  every XYZ  text file  with a three
  366.  digit number.  This number may  range from 009 digits to 053  digits.
  367.  Each numeric  argument thereafter  will take  up the  same amount  of
  368.  significant digits.  If the  number 014  is typed  as the first line,
  369.  then the command "sin number" would   display the sin of "number"  up
  370.  to 14  digits   in  length.  If   that  isn't enough digits  then you
  371.  could change the first  line to read 033  and the "sin number"  would
  372.  display the sine of "number" to 33 digits.
  373.  
  374.  Some examples of a numeric argument name would be:
  375.  
  376.   NUMBER1
  377.   number2
  378.   MAGNETOHYDRODYNAMICS
  379.   GIV-ME.2(OF_THEM)!
  380.   ETC...
  381.   Paid$
  382.  
  383.  Every  numeric  argument  name  must  be  entered in the same format.
  384.  The format is (in this order only):
  385.   1. Give the sign of the number..."-" for negative numbers or nothing
  386.      for positive numbers.
  387.   2. Type the number (and the decimal place wherever it is needed).
  388.   3. Type a small e if you want to enter an exponent in the number.
  389.   4. Give  the sign  of  the  exponent..."-"  for negative  numbers or
  390.      nothing for  positive numbers.   The exponent  cannot be  greater
  391.      than 32767 or smaller than -32767.
  392.  
  393.  Some examples of  how you could  type a number  to be entered  into a
  394.  numeric variable would be:
  395.  
  396.   dat num Paid$=-1.2345e-245
  397.   dat num Paid$=135.7e24
  398.   dat num Paid$=5
  399. ┌─────────────────────────────────────────────────────────────────────┐
  400. │ TEXT argument types...                                              │
  401. └─────────────────────────────────────────────────────────────────────┘
  402.  stores text strings and must be predefined by the command "dat  txt".
  403.  Some examples of a text argument name would be:
  404.  
  405.   NUMBER1
  406.   WHAT!?...
  407.   number2
  408.   1forthe$money$
  409.   2fortheshow
  410. ┌─────────────────────────────────────────────────────────────────────┐
  411. │ RESERVED argument types...                                          │
  412. └─────────────────────────────────────────────────────────────────────┘
  413.  are  already  predefined  by  XYZ.   Using  these  argument types for
  414.  anything else other then their intended use can result in errors. The
  415.  following is a listing of all reserved variables used by XYZ:
  416.  
  417.   The numeric argument: result
  418.   The text argument:    buffer
  419.   The symbols = and *
  420.   These special numeric arguments:
  421.     angle
  422.     blank
  423.     char
  424.     col
  425.     col2
  426.     color
  427.     color2
  428.     dash1
  429.     dash2
  430.     error
  431.     freq
  432.     handle
  433.     hite
  434.     lptn
  435.     mode
  436.     mouse
  437.     row
  438.     row2
  439.     size
  440.     start
  441.     start2
  442.     usr1
  443.     usr2
  444.     usr3
  445.     wide
  446.     xmin
  447.     xmax
  448.     ymin
  449.     ymax
  450.   These special words:
  451.     videomode
  452.     tty
  453.  
  454.  All of the special numeric arguments have been predefined as  numeric
  455.  arguments  for  different  XYZ  commands.  The range of these numeric
  456.  arguments is from  0 to 65535  except for the  word color and  color2
  457.  which has a range  of 0 to 16,777,215.  When used as text  arguments,
  458.  all special arguments will accept only one letter of text.
  459.  
  460.  The two special words listed  above (videomode and tty) are  commands
  461.  to be used with the "set" command.
  462.  
  463.  The numeric variable "result" has a special place in XYZ.  It is  the
  464.  place  where  all  of  the  math  commands  store the result of their
  465.  calculations.  "Result"  must  always  be  the first numeric argument
  466.  following the command (except for "sub").
  467.  
  468.  For example:
  469.  
  470.    add Male and Female
  471.  
  472.  adds the  number of  Males to  the number  of Females  and places the
  473.  result of this calculation in the reserved numeric argument  "result"
  474.  for later retrieval by another command like the following example:
  475.  
  476.    add Male and Female
  477.    div result by Children
  478.  
  479.  which adds  the number  of Males  to the  number of  Females and then
  480.  divides the resulting number by the number of Children.  Notice  that
  481.  the  sub  command  is  the  only  command  in which the first numeric
  482.  argument appears second  so that proper  use of the  sub command when
  483.  using the reserved variable "result" would be:
  484.  
  485.    sub Children from result
  486.  
  487.  The text argument "buffer" is  another case of a special  variable in
  488.  the  XYZ  language.  It  is  a  predefined  text argument that is 300
  489.  characters  in  length.  When  your  XYZ  program  is first run, this
  490.  argument is filled up with the  contents of the command line for  the
  491.  firsts  128  characters  and  gibberish  for  the  rest  of  the text
  492.  argument.
  493. ╔═════════════════════════════════════════════════════════════════════╗
  494. ║ Description of program commands:                                    ║
  495. ╚═════════════════════════════════════════════════════════════════════╝
  496.  Remember...all of the XYZ commands are case sensitive so that if  any
  497.  commands are typed into  a XYZ program other  than the way they  have
  498.  been described  below, they  won't be  recognized as  legal commands.
  499.  Also  each  command  is  three  letters  followed  by  one space. The
  500.  following pages are a listing of each command used by XYZ along  with
  501.  the type and number  of arguments needed for  each command.  A  short
  502.  description is  given of  the use  of each  command and finally, each
  503.  description is followed by an example of that command if needed.
  504. ┌─────────────────────────────────────────────────────────────────────┐
  505. │ /// and adding comments                                             │
  506. └─────────────────────────────────────────────────────────────────────┘
  507.  Since XYZ is such a simple language to write, there is plenty of room
  508.  leftover for typing comments. Comments  can be added right after  the
  509.  last argument of a command (after the space). Comments can make a big
  510.  difference on how  readable your code  is to someone  else because it
  511.  can  be  used  to  explain  the  logic  you  used or to document some
  512.  function without the  reader having to  look it up.   It can also  be
  513.  used to show the routing of  jump commands.  For example, taking  the
  514.  small routine from the mouse command example...
  515.  
  516.    set mouse=0
  517.    mouse button
  518.    jeq LeftButtonPressed
  519.    jne LeftButtonNotPressed
  520.    --- LeftButtonPressed
  521.    mouse cursor=Newcursor
  522.    --- LeftButtonNotPressed
  523.    end with 0
  524.  
  525.  I can add comments to explain what I'm trying to do...
  526.  
  527.    set mouse=0 will check the status of the left...
  528.    mouse button ...when it was last pressed.
  529.    jeq LeftButtonPressed
  530.    jne LeftButtonNotPressed
  531.    --- LeftButtonPressed
  532.    mouse cursor=Newcursor will change the cursor.
  533.    --- LeftButtonNotPressed
  534.    end with 0
  535.  
  536.  Better yet, I can show the  results of each jump, making the  program
  537.  even more readable...
  538.  
  539.    set mouse=0 will check the status of the left...
  540.    mouse button ...when it was last pressed.
  541.    jeq LeftButtonPressed ──────────────────────────┐
  542.    jne LeftButtonNotPressed ─────────────────────┐ │
  543.    --- LeftButtonPressed ────────────────────────│─┘
  544.    mouse cursor NewCursor will change the cursor. │
  545.    --- LeftButtonNotPressed ─────────────────────┘
  546.    end with 0
  547.  
  548.  Finally, the characters "/// " are reserved  as a comment  line. This
  549.  can enable me to separate the program into sections like this...
  550.  
  551.    set mouse=0 will check the status of the left...
  552.    mouse button ...when it was last pressed.
  553.    jeq LeftButtonPressed ──────────────────────────┐
  554.    jne LeftButtonNotPressed ─────────────────────┐ │
  555.    /// If the left mouse button was pressed:      │ │
  556.    --- LeftButtonPressed ────────────────────────│─┘
  557.    mouse cursor=NewCursor will change the cursor. │
  558.    /// Either way we'll end up here anyways...    │
  559.    --- LeftButtonNotPressed ─────────────────────┘
  560.    end with 0
  561.  
  562.  Use your own imagination to come up with even more ways to make  your
  563.  program even more readable then this one.
  564. ┌─────────────────────────────────────────────────────────────────────┐
  565. │ --- LABEL                                                           │
  566. └─────────────────────────────────────────────────────────────────────┘
  567.  The ---  command is  where one  part of  a XYZ  program can reference
  568.  another part of the same program through the jump or goto commands.
  569.  
  570.  For example:
  571.  
  572.    cmp buffer to Error!
  573.    jeq Errors
  574.    goto Elsewhere
  575.    --- Errors
  576.    end 2
  577.  
  578.  If  the  result  of  the  "cmp  buffer  to Error!" is equal, then the
  579.  program will  jump to  the location  labeled "Errors".  From there it
  580.  will end the program with an error level of 2.  If the result of  the
  581.  compare is not equal, then the program will goto the location labeled
  582.  Elsewhere.
  583. ┌─────────────────────────────────────────────────────────────────────┐
  584. │ abs NumericArgument                                                 │
  585. └─────────────────────────────────────────────────────────────────────┘
  586.  Computes the absolute  value of the  numeric argument and  places the
  587.  result in "result".
  588. ┌─────────────────────────────────────────────────────────────────────┐
  589. │ add NumericArgument1 and NumericArgument2                           │
  590. └─────────────────────────────────────────────────────────────────────┘
  591.  Adds the arguments shown and places the result in "result".
  592. ┌─────────────────────────────────────────────────────────────────────┐
  593. │ and TextArgument                                                    │
  594. └─────────────────────────────────────────────────────────────────────┘
  595.  CALL WITH:
  596.  
  597.    set start=<Position of first char>
  598.    set size=<Number of chars to And>
  599.    set char="Character to And with"
  600.  
  601.  Ands TextArgument with the specified character, starting at character
  602.  number  "start".  This  routine  will  end  after  "size"  number  of
  603.  characters have been anded.
  604.  
  605.  For example:
  606.  
  607.    set start=1
  608.    set size=13
  609.    set char=F
  610.    and TextArgument
  611.  
  612.  will And whatever text is in TextArgument with the letter F. It  will
  613.  do  this  starting  with  the  1st  character  until  it has anded 13
  614.  characters altogether.
  615. ┌─────────────────────────────────────────────────────────────────────┐
  616. │ acos NumericArgument                                                │
  617. │ asin NumericArgument                                                │
  618. │ atan NumericArgument                                                │
  619. │ acosh NumericArgument                                               │
  620. │ asinh NumericArgument                                               │
  621. │ atanh NumericArgument                                               │
  622. └─────────────────────────────────────────────────────────────────────┘
  623.  Compute the arccosine, arcsine, arctangent, archypcosine, archypsine,
  624.  or archyptangent  of the  numeric argument  and places  the result in
  625.  "result" (in units of radians).
  626.  
  627.  For example:
  628.  
  629.    arc cos SomeNumber
  630.    arc hyp cos AnotherNumber
  631.  
  632.  will compute the arccosine of SomeNumber and place the result of that
  633.  calculation in "result".  Then the archypcosine of AnotherNumber will
  634.  be computed and placed in "result".
  635.  
  636.  The range for the arc functions are: x²<=1
  637.  except for acosh in which            x²>=1
  638. ┌─────────────────────────────────────────────────────────────────────┐
  639. │ call LABEL                                                          │
  640. │ call TextArgument                                                   │
  641. └─────────────────────────────────────────────────────────────────────┘
  642.  CALL WITH:
  643.  
  644.    set start=<Position within TextArgument to find handle>
  645.  
  646.  Calls the  subroutine labeled  --- LABEL.  Starts executing  the next
  647.  instruction  following  the  ---  LABEL  instruction  until  a  "ret"
  648.  instruction  is  encountered.   Then  XYZ  starts  executing the next
  649.  instruction following the original call instruction.  Also will  call
  650.  the subroutine whose  address is stored  in TextArgument starting  at
  651.  "start".
  652.  
  653.  For example:
  654.  
  655.    set start=1
  656.    set handle=DoSomething
  657.    save handle to TextArgument
  658.    call DoSomething
  659.    call TextArgument
  660.    end with 0
  661.    --- DoSomething
  662.    ret
  663.  
  664.  will call  the subroutine  DoSomething.   DoSomething will  then just
  665.  return  to   the  statement   following  the   call  statement...call
  666.  TextArgument. Call TextArgument is the same as call DoSomething which
  667.  will  just  return  to  the  statement  following this call statement
  668.  "end", which will just end the program.
  669. ┌─────────────────────────────────────────────────────────────────────┐
  670. │ cmp NumericArgument1 to NumericArgument2                            │
  671. └─────────────────────────────────────────────────────────────────────┘
  672.  Compares the first numeric argument to the second.
  673. ┌─────────────────────────────────────────────────────────────────────┐
  674. │ cmp ReservedArgument1 to ReservedArgument2                          │
  675. └─────────────────────────────────────────────────────────────────────┘
  676.  Compares  the  first  reserved  argument  to  the  second.  The  only
  677.  exception to this rule is the reserved argument color because of  its
  678.  wider range  of 0  to 16,777,215.  All other  reserved arguments have
  679.  the range of 0 to 65535.
  680.  
  681.  For example:
  682.  
  683.    cmp size to mouse
  684.    cmp col to blank
  685.  
  686.  is legal while:
  687.  
  688.    cmp color to angle
  689.  
  690.  is not.
  691. ┌─────────────────────────────────────────────────────────────────────┐
  692. │ cmp TextArgument1 to TextArgument2                                  │
  693. └─────────────────────────────────────────────────────────────────────┘
  694.  CALL WITH:
  695.  
  696.    set start=<Position of first character to Cmp in first argument>
  697.    set size=<Number of characters to Cmp>
  698.    set start2=<Position of first character to Cmp in second argument
  699.  
  700.  CoMPares  "size"  number  of  characters  in  the first TEXT argument
  701.  (starting at position "start") to the second TEXT argument  (starting
  702.  at position "start2").  These  reserved arguments must be Set  before
  703.  using  the  cmp  statement  for  the  first  time.   Cmp  counts each
  704.  character it  CoMPares until  it finds  the first  mismatch and  then
  705.  stops  and  reports  its  findings  of  the mismatch as greater than,
  706.  lesser than, equal  to (or some  combination of these).  The location
  707.  of this mismatch is returned to the reserved argument size.
  708.  
  709.  For example:
  710.  
  711.    set start=1
  712.    set size=3
  713.    set start2=2
  714.    cmp Textargument1 to TextArgument2
  715.    jne Somewhere
  716.  
  717.  will take 3  characters of text  in TextArgument1 (starting  with the
  718.  1st character) and  CoMPare it to  whatever text is  in TextArgument2
  719.  (starting  with  the  2nd  character).   If  the  string contained in
  720.  TextArgument1 is
  721.  
  722.    HI!
  723.  
  724.  and the string contained in TextArgument2 is
  725.  
  726.    .HI?
  727.  
  728.  then cmp will  return a less  than and not  equal result to  XYZ, set
  729.  size to 3, and jump to the location --- Somewhere.
  730. ┌─────────────────────────────────────────────────────────────────────┐
  731. │ convert NumericArgument to TextArgument                             │
  732. │ convert ReservedArgument to TextArgument                            │
  733. │ convert TextArgument to result                                      │
  734. │ convert TextArgument to ReservedArgument                            │
  735. └─────────────────────────────────────────────────────────────────────┘
  736.  CALL WITH:
  737.  
  738.    set start=<Position of first character to start at>
  739.  
  740.  The  command  "convert  TextArgument  to  result"   will  start   the
  741.  conversion at "start" number of characters and will stop whenever  it
  742.  reaches either a space or  any invalid character (any character  that
  743.  is not a number). It will ALWAYS place the result in "result".
  744.  
  745.  For  the  command  "convert  NumericArgument  to  TextArgument"   the
  746.  characters will be placed in  the given TextArgument at the  position
  747.  "start" and  "size" will  be set  equal to  the number  of characters
  748.  converted  (how   many  significant   digits  were   placed  in   the
  749.  TextArgument).
  750. ┌─────────────────────────────────────────────────────────────────────┐
  751. │ cos NumericArgument                                                 │
  752. │ sin NumericArgument                                                 │
  753. │ tan NumericArgument                                                 │
  754. │ cosh NumericArgument                                                │
  755. │ sinh NumericArgument                                                │
  756. │ tanh NumericArgument                                                │
  757. └─────────────────────────────────────────────────────────────────────┘
  758.  Computes  the  cos,  sin,  tan,  cosh,  sinh,  or tanh of the numeric
  759.  argument and places the  result in "result". NumericArgument  must be
  760.  given in radians for the trig functions.
  761.  
  762.  The range for these trigs functions are: x²<∞ (infinity)
  763.  except for cosh in which                 x²<=1
  764.  and except for tan in which x cannot equal a multiple of π (pi).
  765. ┌─────────────────────────────────────────────────────────────────────┐
  766. │ dat num NumericArgument=                                            │
  767. │ dat txt ## TextArgument=                                            │
  768. │ dat mouse TextArgument                                              │
  769. └─────────────────────────────────────────────────────────────────────┘
  770.  The dat command is placed at the beginning of every XYZ program after
  771.  the first line (which is reserved for the size of num arguments). The
  772.  dat command  is where  all arguments  to be  used in  the program are
  773.  listed  (except  for  reserved  arguments).   For  example, if a text
  774.  argument is called that is not listed in a dat command, then an error
  775.  will result during compilation. Dat  places data into the numeric  or
  776.  text  argument  during  compilation  if  the  "="  sign  is used as a
  777.  delimiter. This is useful for reducing file sizes by setting  numeric
  778.  or text arguments before the  program has to run rather  then setting
  779.  them during run  time.  If  two dat statements  use the same  text or
  780.  numeric argument name, then the second statement will have no effect.
  781.  
  782.  SETTING TEXT ARGUMENTS...
  783.  
  784.  The  command,  "dat  txt  ##  TextArgument="  is  used  to define and
  785.  initialize  text  arguments.   The  ##  parameter  is used to reserve
  786.  memory for each text argument and can range from one to five thousand
  787.  or more characters in length. This is how much memory is reserved for
  788.  each text argument used. "Dat txt" statements that span more than one
  789.  line should be indented with  four spaces because XYZ will  terminate
  790.  the dat txt  statement when it  encounters ANY character  on the next
  791.  line (including the  TAB character).   Each successive line  starting
  792.  with four blanks will insert the "Enter" key into that text  argument
  793.  starting at the beginning of that line.
  794.  
  795.  For example:
  796.  
  797.    dat txt 00 SomeText=What \in/ the "world" is
  798.        this?
  799.    dat txt 10 MoreText=Hi!
  800.  
  801.  will insert the text string:
  802.  
  803.   What \in/ the "world" is
  804.   this?
  805.  
  806.  into the text argument SomeText, and the text string:
  807.  
  808.   Hi!
  809.  
  810.  into the text argument MoreText.  Notice that the first dat statement
  811.  will reserve only enough bytes of memory to be able to store the text
  812.  string listed, while the second  dat statement will reserve 10  bytes
  813.  of memory for the second text argument but initialize the first three
  814.  bytes to the word "Hi!".
  815.  
  816.  SETTING NUMERIC ARGUMENTS...
  817.  
  818.  The first line of EVERY XYZ  program is a three digit number  ranging
  819.  from 001 to 011. This number specifies how many words to reserve  for
  820.  each numeric argument (a word is two bytes of memory or disk  space).
  821.  This will also determine how  many significant digits will be  in all
  822.  numeric  arguments.   See  the  topic  "NUMERIC  argument  types" for
  823.  examples on the proper syntax for initializing numeric arguments.
  824.  
  825.  For example:
  826.  
  827.    dat num Volume=1.23e-4
  828.    dat num Molecules
  829.  
  830.  will reserve two numeric arguments.  The first will be set to 1.23e-4
  831.  and the second will contain uninitialized data.
  832.  
  833.  SETTING TEXT ARGUMENTS FOR CURSORS...
  834.  
  835.  For defining mouse cursors there is a special dat command. It is "dat
  836.  mouse" and it creates a text argument 34 bytes in length. The  syntax
  837.  is as follows:
  838.  
  839.   dat mouse TextArgument xxxx yyyy ─LOCATION OF THE x,y HOTSPOT
  840.   dat ................ ─First char on this line is point 0,0
  841.   dat .......*........
  842.   dat ......*o*.......
  843.   dat ......*o*.......
  844.   dat ......*o*.......
  845.   dat ......*o*.......
  846.   dat ..***** *****...
  847.   dat .*oooo   oooo*.. ─If you wanted the center of this crosshair
  848.   dat ..***** *****...   to be the cursor hotspot, "xxxx yyyy" would
  849.   dat ......*o*.......   be replaced with the numbers 7 7
  850.   dat ......*o*.......
  851.   dat ......*o*.......
  852.   dat ......*o*.......
  853.   dat .......*........
  854.   dat ................
  855.   dat ................
  856.  
  857.  where  xxxx  and  yyyy  represents  a  number (-127 through 128) that
  858.  refers to a location (relative  to the first character of  the second
  859.  dat  statement)  that  represents  the  location of the cursor...also
  860.  called  the  cursor  hotspot.  The  actual  mouse cursor is assembled
  861.  using four "colors" only. The colors are: black, white,  transparent,
  862.  and inverted. The "*" characters represent black, the "o"  characters
  863.  represent white,  the "."  characters represent  transparent, and the
  864.  " " represents inverted. See  the topic "Sample programs to  compile"
  865.  for  examples  of  how  to  create  a  new  graphics cursor. The word
  866.  TextArgument should be replaced with the name of your cursor such  as
  867.  "crosshair" or something appropriate like that.
  868. ┌─────────────────────────────────────────────────────────────────────┐
  869. │ dec ReservedArgument                                                │
  870. └─────────────────────────────────────────────────────────────────────┘
  871.  Will decrement (subtract one from) the reserved argument shown.
  872. ┌─────────────────────────────────────────────────────────────────────┐
  873. │ div NumericArgument1 by NumericArgument2                            │
  874. └─────────────────────────────────────────────────────────────────────┘
  875.  Divides the  first argument  shown by  the second  argument shown and
  876.  places the result in "result".
  877. ┌─────────────────────────────────────────────────────────────────────┐
  878. │ draw circle                                                         │
  879. │ draw rotated circle                                                 │
  880. │ draw line                                                           │
  881. └─────────────────────────────────────────────────────────────────────┘
  882.  For "draw ellipse" and "draw rotated ellipse", call with:
  883.  
  884.    set wide=<Width of circle>
  885.    set hite=<Height of circle>
  886.    set color=<Color>
  887.    set angle=<Angle in degrees>
  888.    set mode=<Logical graphic function>
  889.    set col=<Column of circle center location>
  890.    set row=<Row of circle center location>
  891.  
  892.  Draws an ellipse in the current  color with it's center at "col"  and
  893.  "row".   The width  of the  ellipse will  be equal  to "wide" and the
  894.  height will  be equal  to "hite".   If wide  equals hite,  then "draw
  895.  ellipse" will draw  a circle.   If the optional  "rotate" argument is
  896.  used then the ellipse will be rotated by an angle of "angle"  degrees
  897.  with respect to the x-axis.  0,0 are the coordinates for the  topmost
  898.  left corner of  the video screen  with the coordinates  increasing in
  899.  value as you  go down and  to the right  on the screen.   The routine
  900.  will draw only partial circles if any of the points fall outside  the
  901.  current "xmin", "xmax", "ymin", and "ymax" settings.
  902.  
  903.  For "draw line", call with:
  904.  
  905.    set blank=<Number of blank points>
  906.    set col=<Beginning column>
  907.    set col2=<Ending column>
  908.    set color=<Color>
  909.    set dash1=<1st number of solid points>
  910.    set dash2=<2nd number of solid points>
  911.    set mode=<Logical graphic function>
  912.    set row=<Beginning row>
  913.    set row2=<Ending row>
  914.  
  915.  Draws a line from col1,row1 to the location col2,row2. The line  will
  916.  be drawn with the current color  "color" and will either (xor and  or
  917.  overwrite) whatever is already on the screen depending on the current
  918.  setting  of  the  reserved  argument  mode  (0=Unmodified  1=And 2=Or
  919.  3=Xor). Line will draw  "dash1" number of pixels followed  by "blank"
  920.  number of blank pixels followed  by "dash2" number of pixels  for the
  921.  length of  the line.   This allows line to  draw dashed  lines, solid
  922.  lines, or dash-dot lines.
  923.  
  924.  For example:
  925.  
  926.  Set these arguments to draw the following line (with each "-"
  927.  representing one pixel):
  928.                 --- -- --- -- --- -- --- -- --- -- ---
  929.                   
  930.    set dash1=3─┘  ││
  931.    set blank=1────┘│
  932.    set dash2=2─────┘
  933.  
  934.  a solid line would need to call draw line with this argument:
  935.  
  936.    set blank=0
  937. ┌─────────────────────────────────────────────────────────────────────┐
  938. │ end with ERRORLEVEL                                                 │
  939. └─────────────────────────────────────────────────────────────────────┘
  940.  Ends  the  XYZ  program  with  a  DOS error level equal to ERRORLEVEL
  941.  (which can range from 0 to 255)
  942.  
  943.  For example:
  944.  
  945.    end with 3
  946. ┌─────────────────────────────────────────────────────────────────────┐
  947. │ eof                                                                 │
  948. └─────────────────────────────────────────────────────────────────────┘
  949.  Eof  stands  for  End  Of  File.  When  the XYZ compiler reaches this
  950.  command, it will quit compiling and ignore all text that follows this
  951.  command. This is useful for tagging extra documentation to you source
  952.  code without having to store it in another file.
  953. ┌─────────────────────────────────────────────────────────────────────┐
  954. │ exp NumericArgument                                                 │
  955. └─────────────────────────────────────────────────────────────────────┘
  956.  Computes e raised to the power of the numeric argument and places the
  957.  result in "result".
  958. ┌─────────────────────────────────────────────────────────────────────┐
  959. │ ext ( TextString )                                                  │
  960. └─────────────────────────────────────────────────────────────────────┘
  961.  XYZ will write  the following group  of four hex  characters directly
  962.  into the program as literal instructions:
  963.  
  964.  For example:
  965.  
  966.    ext ( BE01 12AC 3C1A 7408 8AD0 B402 CD21 EBF3 CD20 )
  967.  
  968.  This statement  will write  the next  18 double  digit hex characters
  969.  into  the  XYZ  file  starting  at  the point where the ext statement
  970.  begins. The characters shown above are the hex representation of  the
  971.  machine code to perform the following commands:
  972.  
  973.        mov si, offset T2+2
  974.    T1: lodsb
  975.        cmp al, 26
  976.        je  T2
  977.        mov dl, al
  978.        mov ah, 02
  979.        int 21h
  980.        jmp T1
  981.    T2: int 20h
  982.  
  983.  NOTE: This command is for very  advanced users and is used mainly  by
  984.  XYZ for patches  or for doing  special fucntions that  users request.
  985.  Also, some  EXT statements  may need  only two  hex characters to end
  986.  the statement so the character "+" is provided as a dummy  character,
  987.  since the EXT command MUST  have four characters per instruction.  If
  988.  the last  instruction in  the example  above needed  to end with "CD"
  989.  instead of "CD20", then the proper syntax would need to be "CD++".
  990. ┌─────────────────────────────────────────────────────────────────────┐
  991. │ file close TextArgument/handle                                      │
  992. │ file create TextArgument                                            │
  993. │ file delete TextArgument                                            │
  994. │ file move TextArgument/handle                                       │
  995. │ file open TextArgument                                              │
  996. │ file read from TextArgument/handle to TextArgument                  │
  997. │ file reset TextArgument/handle                                      │
  998. │ file set TextArgument/handle                                        │
  999. │ file write from TextArgument to TextArgument/handle                 │
  1000. └─────────────────────────────────────────────────────────────────────┘
  1001.  CALL WITH:
  1002.  
  1003.    set size=<Number of bytes or chars>
  1004.    set start=<Postion within TextArgument where handle is stored>
  1005.  
  1006.  All files must be specified by what are called "handles" because this
  1007.  is the way  DOS handles files.   This "handle" is  simply a two  byte
  1008.  binary number that DOS references for information about that file  in
  1009.  order  to  perform  input  or  output  of  that  file  from the disk.
  1010.  TextArgument will contain  just a text  string with the  path name of
  1011.  the file.  TextArgument/Handle will  contain the handle of  the file.
  1012.  "file open TextArgument" is the only command you can use to obtain  a
  1013.  file handle from DOS.
  1014.  
  1015.  File will perform the following file Operations...
  1016.  
  1017.    ┌──────┬────────────────────────────────────────────────────────┐
  1018.    │close │closes the file specified by the handle in TextArgument.│
  1019.    ├──────┼────────────────────────────────────────────────────────┤
  1020.    │create│creates the file  named in  TextArgument.  The dos  file│
  1021.    │      │attribute will be set to "A" or "archive".              │
  1022.    ├──────┼────────────────────────────────────────────────────────┤
  1023.    │delete│deletes the file named in TextArgument.                 │
  1024.    ├──────┼────────────────────────────────────────────────────────┤
  1025.    │move  │increases the file pointer by "size" bytes.             │
  1026.    ├──────┼────────────────────────────────────────────────────────┤
  1027.    │open  │opens  the  existing  file named in  TextArgument.   The│
  1028.    │      │reserved  argument  "handle"  will  be  set  to  the dos│
  1029.    │      │handle for  that file.  The file  pointer will  be reset│
  1030.    │      │for that file.                                          │
  1031.    ├──────┼────────────────────────────────────────────────────────┤
  1032.    │read  │reads  "size"  number  of  bytes  from  handle  of  file│
  1033.    │      │specified in  TextArgument.   The file  pointer will  be│
  1034.    │      │incriminated by "size" or by the actual number  of bytes│
  1035.    │      │read. "size" will be set  to the actual number of  bytes│
  1036.    │      │read.                                                   │
  1037.    ├──────┼────────────────────────────────────────────────────────┤
  1038.    │reset │resets  the  file pointer  to the beginning  of the file│
  1039.    │      │specified by the handle in TextArgument.                │
  1040.    ├──────┼────────────────────────────────────────────────────────┤
  1041.    │set   │sets  the file pointer to the end of the file  specified│
  1042.    │      │by the handle in TextArgument.                          │
  1043.    ├──────┼────────────────────────────────────────────────────────┤
  1044.    │write │writes  "size"  number  of  bytes from  handle  of  file│
  1045.    │      │specified in TextArgument1  to TextArgument2.   The file│
  1046.    │      │pointer will be incriminated by "size" or by  the actual│
  1047.    │      │number of bytes read.  "Size" will be set to the  actual│
  1048.    │      │number of bytes read.                                   │
  1049.    └──────┴────────────────────────────────────────────────────────┘
  1050.  
  1051.  If any operation  fails, then the  reserved argument "error"  will be
  1052.  set to the DOS error code and the error flag will be set for the  jer
  1053.  command to work.
  1054.  
  1055.  For  example  (assume  the  file  README.TXT  exists in the directory
  1056.  C:\DOS\UTILITIES\DOS\ and  reads "Scooby Dooby Doo"  and is therefore
  1057.  only 16 bytes in size):
  1058.  
  1059.    dat txt 00 FileName=C:\DOS\UTILITYS\DOC\README.TXT
  1060.    dat txt 00 NewText= we love you!
  1061.    dat txt 00 ErrMessage=Couldn't open file!
  1062.    dat txt 02 MyFile will be the handle for README.TXT
  1063.    set start=1
  1064.    file open FileName will open README.TXT...
  1065.    jer Oops! ...unless we couldn't find it!
  1066.    convert handle to MyFile
  1067.    set size=16 get ready to read 16 bytes...
  1068.    file read MyFile to buffer
  1069.    set size=12 since NewText is 12 bytes long
  1070.    file write NewText to MyFile
  1071.    file reset MyFile
  1072.    set size=28
  1073.    file read MyFile to buffer
  1074.    tty buffer
  1075.    file close MyFile
  1076.    end with 0 because everything went O.K.
  1077.    --- Oops!
  1078.    tty ErrMessage will print "Couldn't open file!" to screen.
  1079.    end with 1 because we had an error!
  1080.  
  1081.  Wow! Okay, what this example does  is first open the file whose  path
  1082.  name is in the  text argument FileName.   If the file doesn't  exist,
  1083.  the  program  will  detect  the  error  and goto the subroutine Oops!
  1084.  where it will end the program with an error level of 1.  If not  then
  1085.  it will read  16 bytes\chars into  the reserved text  argument buffer
  1086.  from the  file.   buffer will  now contain  the string  "Scooby Dooby
  1087.  Doo".  Next,  12 bytes\chars from  the text argument  NewText will be
  1088.  written to the file, starting  from wherever the last file  operation
  1089.  left the file  pointer at.   When the file  pointer is reset  to 0 by
  1090.  the file reset  command and the  file is reread  into buffer, we  see
  1091.  that buffer  will now  contain the  string "Scooby  Dooby Doo we love
  1092.  you!". Last  of all,  the file  will be  closed and  the program will
  1093.  exit with an error code of 0.
  1094. ┌─────────────────────────────────────────────────────────────────────┐
  1095. │ find char in TextArgument                                           │
  1096. └─────────────────────────────────────────────────────────────────────┘
  1097.  CALL WITH:
  1098.  
  1099.    set start=<What position to start at>
  1100.    set char=<Character to search for>
  1101.  
  1102.  Finds a  character in  the text  argument that  matches the character
  1103.  typed after char=, starting  from position "start". Find  counts each
  1104.  character it compares until it  finds the first match and  then stops
  1105.  and reports the location of  this match in reserved argument  "start"
  1106.  and also reports the number of characters it searched until it  found
  1107.  the match in reserved argument "size".
  1108.  
  1109.  For example:
  1110.  
  1111.    set char=Q
  1112.    set start=22
  1113.    find char in TextString
  1114.  
  1115.  will  search  for  the  letter  Q  in  the  text argument TextString,
  1116.  starting at the 22nd character in TextString.
  1117. ┌─────────────────────────────────────────────────────────────────────┐
  1118. │ goto LABEL                                                          │
  1119. │ goto TextArgument                                                   │
  1120. └─────────────────────────────────────────────────────────────────────┘
  1121.  Go to the subroutine labeled --- LABEL.
  1122. ┌─────────────────────────────────────────────────────────────────────┐
  1123. │ inc ReservedArgument                                                │
  1124. └─────────────────────────────────────────────────────────────────────┘
  1125.  Will increment (add one to) the reserved argument shown.
  1126. ┌─────────────────────────────────────────────────────────────────────┐
  1127. │ input TextArgument                                                  │
  1128. └─────────────────────────────────────────────────────────────────────┘
  1129.  CALL WITH:
  1130.  
  1131.    set start=<Position of first character to input in buffer>
  1132.    set size=<Number of characters to receive>
  1133.  
  1134.  Input waits for a key to be entered into the text argument. Any ASCII
  1135.  character may be entered in the  text string. It also returns a  scan
  1136.  code in the  reserved argument scan  if the keyboard  returns a blank
  1137.  (00 hex) character. This is useful for getting certain keys (like the
  1138.  function keys).
  1139.  
  1140.  For example:
  1141.  
  1142.    set start=3
  1143.    set size=24
  1144.    inp TextArgument
  1145.  
  1146.  will input a statement that will get 24 characters from the  keyboard
  1147.  and place it starting at the 3rd character location of TextArgument.
  1148. ┌─────────────────────────────────────────────────────────────────────┐
  1149. │ int HexInterruptNumber ax= bx= cx= dx= di= si= bp= es= ds=          │
  1150. └─────────────────────────────────────────────────────────────────────┘
  1151.  CALL WITH:
  1152.  
  1153.    set start=<Position within TextArgument to find handle>
  1154.  
  1155.  Performs the  hex interrupt  indicated.   Then it  sets the registers
  1156.  according  to  the  hex  values  set  with the arguments shown in the
  1157.  command above. All hex  numbers must be four  digits in length.   The
  1158.  number one would  be entered as  0001 and the  number 65535 would  be
  1159.  entered  as  FFFF.   For  setting  register  values  to point to text
  1160.  arguments, the reserved argument "start" must be set to the  position
  1161.  where to find the handle of a text argument within that TextArgument.
  1162.  Use caution  with this  command if  the ds  or es  registers will  be
  1163.  changed upon return of the interrupt.
  1164.  
  1165.  For example:
  1166.  
  1167.    set start=1
  1168.    set handle=TextString
  1169.    save handle to TextArgument
  1170.    int 21 ax=3900 dx=TextArgument
  1171.  
  1172.  will perform interrupt  21h, service ax=3900h  (Create Subdirectory).
  1173.  Upon  entry,  dx  will  contain  the  address  to  the  text argument
  1174.  TextString (which is always in the current data segment for XYZ).
  1175. ┌─────────────────────────────────────────────────────────────────────┐
  1176. │ ior TextArgument                                                    │
  1177. └─────────────────────────────────────────────────────────────────────┘
  1178.  CALL WITH:
  1179.  
  1180.    set start=<Position of first character to ior>
  1181.    set size=<Number of characters to ior>
  1182.    set char=<Character to ior with>
  1183.  
  1184.  Inclusively  ORs  the  text  argument  with  the specified character,
  1185.  starting at character number "start1".   This routine will end  after
  1186.  size of characters have been iored.
  1187.  
  1188.  For example:
  1189.  
  1190.    set start=4
  1191.    set size=23
  1192.    set char=R
  1193.    ior TextArgument
  1194.  
  1195.  will or  the text  argument with  the letter  R starting  at the  4th
  1196.  character and will or 23 characters altogether.
  1197. ┌─────────────────────────────────────────────────────────────────────┐
  1198. │ jeq LABEL                                                           │
  1199. │ jeq TextArgument                                                    │
  1200. └─────────────────────────────────────────────────────────────────────┘
  1201.  CALL WITH:
  1202.  
  1203.    set start=<Position within Textargument to find handle>
  1204.  
  1205.  If the result of the preceding cmp statement was EQUAL, then goto the
  1206.  subroutine labeled --- LABEL in the program.
  1207. ┌─────────────────────────────────────────────────────────────────────┐
  1208. │ jer LABEL                                                           │
  1209. │ jer TextArgument                                                    │
  1210. └─────────────────────────────────────────────────────────────────────┘
  1211.  CALL WITH:
  1212.  
  1213.    set start=<Position within TextArgument to find handle>
  1214.  
  1215.  If the result of  the last operation caused  an error, then goto  the
  1216.  subroutine labeled --- LABEL in the program.
  1217. ┌─────────────────────────────────────────────────────────────────────┐
  1218. │ jge LABEL                                                           │
  1219. │ jge TextArgument                                                    │
  1220. └─────────────────────────────────────────────────────────────────────┘
  1221.  CALL WITH:
  1222.  
  1223.    set start=<Position within Textargument to find handle>
  1224.  
  1225.  If the  result of  the preceding  cmp statement  was GREATER  than or
  1226.  EQuaL, then goto the subroutine labeled --- LABEL in the program.
  1227. ┌─────────────────────────────────────────────────────────────────────┐
  1228. │ jgt LABEL                                                           │
  1229. │ jgt TextArgument                                                    │
  1230. └─────────────────────────────────────────────────────────────────────┘
  1231.  CALL WITH:
  1232.  
  1233.    set start=<Position within Textargument to find handle>
  1234.  
  1235.  If the result of the  preceding cmp statement was GREATER  THAN, then
  1236.  goto the subroutine labeled --- LABEL in the program.
  1237. ┌─────────────────────────────────────────────────────────────────────┐
  1238. │ jle LABEL                                                           │
  1239. │ jle TextArgument                                                    │
  1240. └─────────────────────────────────────────────────────────────────────┘
  1241.  CALL WITH:
  1242.  
  1243.    set start=<Position within Textargument to find handle>
  1244.  
  1245.  If the result of the preceding cmp statement was LESS THAN or  EQUAL,
  1246.  then goto the subroutine labeled --- LABEL in the program.
  1247. ┌─────────────────────────────────────────────────────────────────────┐
  1248. │ jlt LABEL                                                           │
  1249. │ jlt TextArgument                                                    │
  1250. └─────────────────────────────────────────────────────────────────────┘
  1251.  CALL WITH:
  1252.  
  1253.    set start=<Position within Textargument to find handle>
  1254.  
  1255.  If the result of the preceding cmp statement was LESS THAN, then goto
  1256.  the subroutine labeled --- LABEL in the program.
  1257. ┌─────────────────────────────────────────────────────────────────────┐
  1258. │ jne LABEL                                                           │
  1259. │ jne TextArgument                                                    │
  1260. └─────────────────────────────────────────────────────────────────────┘
  1261.  CALL WITH:
  1262.  
  1263.    set start=<Position within Textargument to find handle>
  1264.  
  1265.  If the result of the preceding cmp statement was NOT EQUAL, then goto
  1266.  the subroutine labeled --- LABEL in the program.
  1267. ┌─────────────────────────────────────────────────────────────────────┐
  1268. │ len TextArgument                                                    │
  1269. └─────────────────────────────────────────────────────────────────────┘
  1270.  Gets the  LENgth of  the string  in the  TextArgument and places that
  1271.  value in the reserved variable size. It starts by counting the  first
  1272.  character  in  the  argument  until  it  reaches  the  first  "Enter"
  1273.  character.
  1274. ┌─────────────────────────────────────────────────────────────────────┐
  1275. │ log NumericArgument                                                 │
  1276. └─────────────────────────────────────────────────────────────────────┘
  1277.  Computes the natural LOGarithm of the numeric argument and places the
  1278.  result in "result".
  1279. ┌─────────────────────────────────────────────────────────────────────┐
  1280. │  mouse Command                                                      │
  1281. │  mouse cursor=TextArgument                                          │
  1282. └─────────────────────────────────────────────────────────────────────┘
  1283.  is the  command for  controlling the  mouse. The  following text is a
  1284.  list of the various mouse functions controlled by mouse:
  1285.  
  1286.    ┌──────┬─────────────────────────────────────────────────────────┐
  1287.    │button│Will  return  the status of  the mouse buttons. There are│
  1288.    │      │two buttons (left  and right) which  can be in one of two│
  1289.    │      │states (pressed or released). The jeq or jne command  can│
  1290.    │      │be used to detect whether or not a button was  pressed or│
  1291.    │      │released after the but command executes. Jeq is the  same│
  1292.    │      │as saying jump if true and jne is the same as saying jump│
  1293.    │      │if false.   But will  also return  the coordinates of the│
  1294.    │      │mouse  cursor  hot  spot  to  the  col  and  row reserved│
  1295.    │      │arguments (they will remain unchanged if the button being│
  1296.    │      │checked had not  been pressed or  released since the last│
  1297.    │      │call to but). Notice that when rat but is called with... │
  1298.    │      ├─────────────────────────────────────────────────────────┤
  1299.    │      │mouse set equal to 0, then the status of the  left button│
  1300.    │      │being pressed will be checked.                           │
  1301.    │      ├─────────────────────────────────────────────────────────┤
  1302.    │      │mouse set  equal  to  1,  then  the  status  of the right│
  1303.    │      │button being pressed will be checked.                    │
  1304.    │      ├─────────────────────────────────────────────────────────┤
  1305.    │      │mouse set  equal  to  2,  then the simultaneous status of│
  1306.    │      │both buttons being pressed will be checked.              │
  1307.    │      ├─────────────────────────────────────────────────────────┤
  1308.    │      │mouse set equal to 3,  then the status of the left button│
  1309.    │      │being released will be checked.                          │
  1310.    │      ├─────────────────────────────────────────────────────────┤
  1311.    │      │mouse set  equal  to  4,  then  the  status  of the right│
  1312.    │      │button being released will be checked.                   │
  1313.    │      ├─────────────────────────────────────────────────────────┤
  1314.    │      │mouse set  equal  to  5,  then the simultaneous status of│
  1315.    │      │both buttons being released will be checked.             │
  1316.    ├──────┼─────────────────────────────────────────────────────────┤
  1317.    │cursor│Will  change the  graphics  cursor to the graphics cursor│
  1318.    │      │stored  in  TextArgument.  The  cursor  must  have   been│
  1319.    │      │created by a dat mouse  statement at the beginning of the│
  1320.    │      │XYZ source file.                                         │
  1321.    ├──────┼─────────────────────────────────────────────────────────┤
  1322.    │hide  │Hides mouse cursor.                                      │
  1323.    ├──────┼─────────────────────────────────────────────────────────┤
  1324.    │horz  │Sets  the   Min/Max  range  for   the  horizontal  cursor│
  1325.    │      │position.Called with the Min range in the col and the Max│
  1326.    │      │range in the row reserved arguments.                     │
  1327.    ├──────┼─────────────────────────────────────────────────────────┤
  1328.    │pen   │Turns light pen on if mouse is set  equal to 1 and  turns│
  1329.    │      │the light pen off if mouse is set equal to 0 when the pen│
  1330.    │      │routine is called.                                       │
  1331.    ├──────┼─────────────────────────────────────────────────────────┤
  1332.    │reset │Turns on the mouse and resets it.                        │
  1333.    ├──────┼─────────────────────────────────────────────────────────┤
  1334.    │show  │Displays cursor.                                         │
  1335.    ├──────┼─────────────────────────────────────────────────────────┤
  1336.    │vert  │Sets the Min/Max range for the vertical  cursor position.│
  1337.    │      │Called with the Min range in the row and the Max range in│
  1338.    │      │the col reserved arguments.                              │
  1339.    └──────┴─────────────────────────────────────────────────────────┘
  1340.  
  1341.  For example:
  1342.  
  1343.    set mouse=0
  1344.    mouse button
  1345.    jeq LeftButtonPressed
  1346.    jne LeftButtonNotPressed
  1347.    --- LeftButtonPressed
  1348.    mouse cursor=NewCursor
  1349.    --- LeftButtonNotPressed
  1350.    end
  1351.  
  1352.  will jump to the label "--- LeftButtonPressed" if the right button of
  1353.  the mouse was  pressed, load a  new mouse cursor  stored in the  text
  1354.  argument NewCursor, then quit  the program. Otherwise, XYZ  will jump
  1355.  to the label "--- LeftButtonNotPressed" and quit.
  1356. ┌─────────────────────────────────────────────────────────────────────┐
  1357. │ mul NumericArgument1 by NumericArgument2                            │
  1358. └─────────────────────────────────────────────────────────────────────┘
  1359.  Multiplies the first  numeric argument or constant argument with  the
  1360.  second and places the result in "result".
  1361. ┌─────────────────────────────────────────────────────────────────────┐
  1362. │ neg NumericArgument                                                 │
  1363. └─────────────────────────────────────────────────────────────────────┘
  1364.  NEGates the numeric argument.
  1365. ┌─────────────────────────────────────────────────────────────────────┐
  1366. │ plot                                                                │
  1367. └─────────────────────────────────────────────────────────────────────┘
  1368.  CALL WITH:
  1369.  
  1370.    set color=<Color>
  1371.    set angle=<Angle in degrees>
  1372.    set col=<Center of rotation...X position>
  1373.    set row=<Center of rotation...Y position>
  1374.    set col2=<Point starting...X position>
  1375.    set row2=<Point starting...Y position>
  1376.  
  1377.  Plots the current color "color" to  the given Column and Row (in  the
  1378.  reserved arguments  row2 and  col2. The  point will  be rotated by an
  1379.  angle of "angle"   degrees with respect  to the x-axis  of the  video
  1380.  screen. 0,0 are  the coordinates for  the topmost left  corner of the
  1381.  video screen with the coordinates increasing in value as you go  down
  1382.  and to the right on the screen.  The routine will not draw any points
  1383.  if  any  of  the  points  fall  outside  the  current "xmin", "xmax",
  1384.  "ymin", and "ymax" settings.
  1385. ┌─────────────────────────────────────────────────────────────────────┐
  1386. │ prn TextArgument                                                    │
  1387. └─────────────────────────────────────────────────────────────────────┘
  1388.  CALL WITH:
  1389.  
  1390.    set start=<Position of first character to Prn>
  1391.    set size=<Number of characters to Prn>
  1392.    set lptn=<LPTn to use>
  1393.  
  1394.  Prints the contents of the given text argument starting at  character
  1395.  "start" and stopping after "size" characters have been printed.
  1396.  
  1397.  For example:
  1398.  
  1399.    set lptn=1
  1400.    set start=2
  1401.    set size=21
  1402.    prn TextArgument
  1403.  
  1404.  will print all the text stored in TextArgument (starting with the 2nd
  1405.  character and ending with the 23rd) out to the printer LPT1.
  1406.  
  1407.  NOTE:  LPT  numbers  start  at  0  and  go up to 3. Most printers are
  1408.  connected to LPT0 which is the default parallel or printer port  that
  1409.  comes with most IBM compatible  computers (IBM is a trademark  of IBM
  1410.  Corp). The second printer will be connected to LPT1 and so on.
  1411. ┌─────────────────────────────────────────────────────────────────────┐
  1412. │ push TextArgument                                                   │
  1413. │ pop TextArgument                                                    │
  1414. │ push ReservedArgument                                               │
  1415. │ pop ReservedArgument                                                │
  1416. └─────────────────────────────────────────────────────────────────────┘
  1417.  CALL WITH:
  1418.  
  1419.    set start=<Position within TextArgument to make pop or push>
  1420.  
  1421.  These two instructions are the  most dangerous commands that you  can
  1422.  use. Since push  will save two  characters (ie --  one word, starting
  1423.  at position "start" within the called text argument or will save  the
  1424.  reserved  argument)  on  the  executable  file's stack, and since the
  1425.  stack is also where  the next return address  for a call function  is
  1426.  stored, you must  be sure to  pop whatever you  push or your  program
  1427.  will crash.
  1428.  
  1429.  Pop  will  restore  two  characters  (one  word) starting at position
  1430.  "start"  within  the  called  text  argument  or  will restore to the
  1431.  reserved argument.  These characters (or word) will be restored  from
  1432.  whatever is on the executable file's stack.
  1433.  
  1434.  The  exception  to  this  command  is  for  pushing  and  popping the
  1435.  reserved arguments "color" and  "color2". This is a  three  character
  1436.  save and restore and therefore these two reserved arguments can  only
  1437.  be used with each other.
  1438. ┌─────────────────────────────────────────────────────────────────────┐
  1439. │ read                                                                │
  1440. └─────────────────────────────────────────────────────────────────────┘
  1441.  CALL WITH:
  1442.  
  1443.    set col2=<Column>
  1444.    set row2=<Row>
  1445.  
  1446.  Reads the color of the pixel at  the Column and Row given by the  col
  1447.  and row  reserved arguments  and places  it in  the reserved argument
  1448.  color2.
  1449.  
  1450.  For example:
  1451.  
  1452.    set col2=640
  1453.    set row2=480
  1454.    set color=12 00 00
  1455.    read
  1456.    cmp color to color2
  1457.    jle Somewhere
  1458.  
  1459.  will read the color of the pixel at location (640, 480) of the screen
  1460.  and compare the  color returned to  the color placed  in the reserved
  1461.  argument "color". If it  is less than or  equal to that then  it will
  1462.  jump to the label called Somewhere.
  1463. ┌─────────────────────────────────────────────────────────────────────┐
  1464. │ ret                                                                 │
  1465. └─────────────────────────────────────────────────────────────────────┘
  1466.  RETurns from a subroutine to the CALLing routine. See the topic 
  1467.  "call".
  1468. ┌─────────────────────────────────────────────────────────────────────┐
  1469. │ save Textargument1 to TextArgument2                                 │
  1470. │ save NumericArgument1 to NumericArgument2                           │
  1471. └─────────────────────────────────────────────────────────────────────┘
  1472.  CALL WITH:
  1473.  
  1474.    set start=<Position of first character to Sav>
  1475.    set size=<Number of characters to Sav>
  1476.    set start2=<Position of first character to Sav in second argument>
  1477.  
  1478.  Saves the contents  of the first  text or numeric  argument (starting
  1479.  with character "start"  until "size" characters  have been saved)  by
  1480.  placing it into the second text or numeric argument (starting at  the
  1481.  position "start2").  For  the numeric arguments, "start",  "size", and
  1482.  "start2" have no effect.
  1483.  
  1484.  For example:
  1485.  
  1486.    set start=2
  1487.    set size=13
  1488.    set start2=3
  1489.    save ThisString to ThatString
  1490.  
  1491.  will take 13 characters of text in ThisString (starting with the  2nd
  1492.  character)  and  save  it  to  ThatString  (starting  with  the   3rd
  1493.  character).
  1494. ┌─────────────────────────────────────────────────────────────────────┐
  1495. │ scr to TextArgument                                                 │
  1496. │ scr from TextArgument                                               │
  1497. └─────────────────────────────────────────────────────────────────────┘
  1498.  CALL WITH:
  1499.  
  1500.    set wide=<Width>
  1501.    set hite=<Height>
  1502.    set col=<Starting Col>
  1503.    set row=<Starting Row>
  1504.  
  1505.  Copies the contents of  the SCReen  to memory  or from  memory to the
  1506.  screen.  The reserved argument  "hite" determines the height and  the
  1507.  reserved  argument  "wide"  determines  the  width  of the area to be
  1508.  copied from  the screen  to the  memory.   The starting  point of the
  1509.  copy routine is col,row.
  1510. ┌─────────────────────────────────────────────────────────────────────┐
  1511. │ set ReservedArgument=Number <or "character">                        │
  1512. │ set TextArgument=ReservedArgument                                   │
  1513. │ set handle=<any argument or label>                                  │
  1514. │ set tty cursor                                                      │
  1515. │ set tty blink                                                       │
  1516. │ set videomode=<see list>                                            │
  1517. └─────────────────────────────────────────────────────────────────────┘
  1518.  Sets the reserved argument equal  to a number, where number  equals 0
  1519.  to 65535  (16,777,215 for  the reserved  argument color)  or sets the
  1520.  reserved argument equal  to a single  character.  The  number may not
  1521.  exceed the range defined for that reserved argument as defined in the
  1522.  section RESERVED arguments.
  1523.  
  1524.  For example:
  1525.  
  1526.    set angle=33000
  1527.    set char=D
  1528.  
  1529.  will set the reserved argument  angle equal to 33,000 and  places the
  1530.  letter D in reserved argument char.
  1531.  
  1532.  ---------------------------------------------------------------------
  1533.  
  1534.  The command "set handle=" is a special case for the set command. When
  1535.  "set handle=" is used, handle will be set to the address of a label 
  1536.  or argument only. Set handle cannot be set to equal a character or a 
  1537.  number like the other reserved arguments can.
  1538.  
  1539.  For example:
  1540.  
  1541.    set handle=TextArgument
  1542.    set handle=LABEL
  1543.  
  1544.  ---------------------------------------------------------------------
  1545.  
  1546.  Setting the reserved arguments "color" or "color2" is also a  special
  1547.  case in that you  must list three 2-digit  hex numbers in a  row like
  1548.  this:
  1549.  
  1550.    set color=XX YY ZZ
  1551.  
  1552.  The  reason  for  using  hex  numbers  is because almost all computer
  1553.  reference books  list colors  in terms  of hex  numbers. This way you
  1554.  won't have to convert from hex  to decimal or vice versa, when  doing
  1555.  research on these various modes:
  1556.  
  1557.     In text modes      XX should equal the color
  1558.                        YY should equal the page number
  1559.                        ZZ should equal 00
  1560.     In 16 color modes  XX should equal the color
  1561.                        YY should equal 00
  1562.                        ZZ should equal 00
  1563.     In 256 color modes XX should equal the color
  1564.                        YY should equal 00
  1565.                        ZZ should equal 00
  1566.     In SVGA modes      XX should equal the red color component
  1567.                        YY should equal the green color component
  1568.                        ZZ should equal the blue color component
  1569.  
  1570.  ---------------------------------------------------------------------
  1571.  
  1572.  For the "set tty cursor" and "set tty blink", call with:
  1573.  
  1574.    set color=<Color and attribute of character to print>
  1575.    set start=<Position of first character to print>
  1576.    set size=<Number of characters to print>
  1577.    set col=<Cursor column>
  1578.    set row=<Cursor row>
  1579.    set mode=<1 or 0>
  1580.  
  1581.  To change the cursor position, use the "set tty cursor" option to set
  1582.  the cursor  to the  coordinates specified  by the  reserved arguments
  1583.  "row" and "col".
  1584.  
  1585.  To  change  the  character  attribute  in  text  modes  or change the
  1586.  character color in graphics modes, use the reserved argument  "color"
  1587.  set to a number from 00-FF (See Appendix)
  1588.  
  1589.  To  change  the  available  attribute  from  blinking  colors to high
  1590.  intensity colors (in text modes only), use the "set tty blink" option
  1591.  with  "mode"  set  to  1  for  using  blinking attributes or to 0 for
  1592.  high-intensity attributes.
  1593.  
  1594.  For example:
  1595.  
  1596.    set col=0
  1597.    set row=0
  1598.    set tty cursor
  1599.    set mode=0
  1600.    set tty blink
  1601.    set color=135
  1602.    set start=1
  1603.    set size=99
  1604.    tty ThisString
  1605.  
  1606.  will place the cursor at the topmost left corner of the screen.  Then
  1607.  it  will  choose  high  intensity  attributes  meaning that the color
  1608.  number 135  will be  high-intensity white  on a  black background. It
  1609.  will print text to the  screen, starting from the first  character in
  1610.  the  text  argument   ThisString  until  it   finishes  printing   99
  1611.  characters (about two rows).
  1612.  
  1613.  ---------------------------------------------------------------------
  1614.  
  1615.  For  the  "set  videomode="  command,  XYZ  currently  supports   the
  1616.  following EGA/VGA video modes (Where  A equals Mode, B equals  Number
  1617.  of  colors,  C  equals  Rows  x  Columns,  and D equals Type of video
  1618.  displayed):
  1619.  
  1620.   ┌───┬─────┬─────────┬────────┐
  1621.   │  A│    B│        C│       D│
  1622.   ├───┼─────┼─────────┼────────┤
  1623.   │  2│   16│    80x25│    Text│
  1624.   │  3│   16│    80x25│    Text│
  1625.   ├───┼─────┼─────────┼────────┤
  1626.   │ 13│  256│  320x200│Graphics│
  1627.   ├───┼─────┼─────────┼────────┤
  1628.   │ 10│   16│  640x350│Graphics│
  1629.   ├───┼─────┼─────────┼────────┤
  1630.   │ 12│   16│  640x480│Graphics│
  1631.   └───┴─────┴─────────┴────────┘
  1632.  
  1633.  and the following Super VGA video modes:
  1634.  
  1635.   ┌───┬─────┬─────────┬────────┐
  1636.   │108│   16│    80x60│    Text│
  1637.   │109│   16│   132x25│    Text│
  1638.   │10A│   16│   132x43│    Text│
  1639.   │10B│   16│   132x50│    Text│
  1640.   │10C│   16│   132x60│    Text│
  1641.   ├───┼─────┼─────────┼────────┤
  1642.   │101│  256│  640x480│Graphics│
  1643.   │110│  32K│  640x480│Graphics│
  1644.   │111│  64K│  640x480│Graphics│
  1645.   │112│16.8M│  640x480│Graphics│
  1646.   ├───┼─────┼─────────┼────────┤
  1647.   │102│   16│  800x600│Graphics│
  1648.   │103│  256│  800x600│Graphics│
  1649.   │113│  32K│  800x600│Graphics│
  1650.   │114│  64K│  800x600│Graphics│
  1651.   │115│16.8M│  800x600│Graphics│
  1652.   ├───┼─────┼─────────┼────────┤
  1653.   │105│  256│ 1024x768│Graphics│
  1654.   │116│  32K│ 1024x768│Graphics│
  1655.   │117│  64K│ 1024x768│Graphics│
  1656.   │118│16.8M│ 1024x768│Graphics│
  1657.   ├───┼─────┼─────────┼────────┤
  1658.   │107│  256│1280x1024│Graphics│
  1659.   │119│  32K│1280x1024│Graphics│
  1660.   │11A│  64K│1280x1024│Graphics│
  1661.   │11B│16.8M│1280x1024│Graphics│
  1662.   └───┴─────┴─────────┴────────┘
  1663.  
  1664.  XYZ Super VGA  modes are based  on the VESA  standard and it  must be
  1665.  loaded  in  either  AUTOEXEC.BAT,  CONFIG.SYS,  or is included in the
  1666.  video board hardware.
  1667.  
  1668.  The  VGA/EGA  graphics  modes  2-13  and  modes 108-10C have what are
  1669.  called color  palettes.   This color  palette is  filled with as many
  1670.  colors as that mode  will support.  Sixteen  color modes will have  a
  1671.  sixteen color palette  with each color  numbered 00 through  0F.  256
  1672.  color modes will  have a 256  color palette with  each color numbered
  1673.  00 through FF.  The colors  defined by each number are predefined  by
  1674.  the VGA/EGA standard.  For  all other graphics modes, the  colors are
  1675.  defined  by  the  actual  number  placed  on  the  screen by the plot
  1676.  routine.  See  appendix  A  for  charts  on the actual definitions of
  1677.  colors for the various modes.
  1678.  
  1679.  As  of  this  writing,  there  is  no  support for the mouse graphics
  1680.  cursor in Super  VGA modes because  no standard has  been adopted yet
  1681.  by all manufacturers  that will allow  programmers to have  access to
  1682.  the  mouse  cursor  in  Super  VGA  modes.  My options are to write a
  1683.  non-standard interface for  you, wait for  manufacturers to come  out
  1684.  with a  standard, or  provide source  code on  how to  write your own
  1685.  interface. If you don't mind, please  drop me a line and let  me know
  1686.  which option you think would be best.
  1687. ┌─────────────────────────────────────────────────────────────────────┐
  1688. │ slm Mode                                                            │
  1689. └─────────────────────────────────────────────────────────────────────┘
  1690.  Sets the  Line Mode  for text  modes (if  possible) to  23, 43, or 50
  1691.  line mode. The screen will be cleared after the slm command has  been
  1692.  used.
  1693.  
  1694.  For example:
  1695.  
  1696.    slm 50
  1697.  
  1698.  will  set  the  current text  mode display to  50 lines if  I  am  in
  1699.  video mode 2 or 3.
  1700. ┌─────────────────────────────────────────────────────────────────────┐
  1701. │ snd                                                                 │
  1702. │ snd off                                                             │
  1703. └─────────────────────────────────────────────────────────────────────┘
  1704.  CALL WITH:
  1705.  
  1706.    set freq=<Freq>
  1707.  
  1708.  Modulates  the  pc  speaker  with  the  specified  frequency  in  the
  1709.  reserved argument freq. Once  a frequency is   set the  speaker  will
  1710.  continue to Sound  until another snd   statement is encountered  that
  1711.  either changes the frequency or turns it off.
  1712.  
  1713.  For example:
  1714.  
  1715.    set freq=256
  1716.    snd
  1717.  
  1718.  will cause the PC speaker to oscillate at 256 hertz.
  1719. ┌─────────────────────────────────────────────────────────────────────┐
  1720. │ sub NumericArgument2 from NumericArgument1                          │
  1721. └─────────────────────────────────────────────────────────────────────┘
  1722.  SUBtracts the arguments shown and places the result in "result".
  1723.  
  1724.  For example:
  1725.  
  1726.    sub NumericArgument2 from NumericArgument1
  1727. ┌─────────────────────────────────────────────────────────────────────┐
  1728. │ tty TextArgument                                                    │
  1729. └─────────────────────────────────────────────────────────────────────┘
  1730.  Prints the given text argument to the screen. The ASCII codes for the
  1731.  bell(07),  the  backspace(08),  the  linefeed(10),  and  the carriage
  1732.  return(13) are translated to the  appropriate actions.  Line wrap and
  1733.  scrolling are  also performed  automatically. In  graphics modes, tty
  1734.  will only print out to the monitor using color codes 1 - 255 (See the
  1735.  chart in appendix A).
  1736. ┌─────────────────────────────────────────────────────────────────────┐
  1737. │ wait ##                                                             │
  1738. └─────────────────────────────────────────────────────────────────────┘
  1739.  Wait will do nothing until ## of DOS ticks have elapsed. One DOS tick
  1740.  is equal to 55mS and is the same on all IBM compatible computers.  If
  1741.  ## equals 18, then wait will do nothing until one second has elapsed.
  1742.  This is  useful for  automatic pausing  before resuming  a task.  The
  1743.  maximum number of DOS ticks is 65535 which is about one hour.
  1744. ┌─────────────────────────────────────────────────────────────────────┐
  1745. │ xor TextArgument with Character                                     │
  1746. │ xor TextArgument1 with TextArgument2                                │
  1747. └─────────────────────────────────────────────────────────────────────┘
  1748.  CALL WITH:
  1749.  
  1750.    set start=<Position of first character to Xor>
  1751.    set size=<Number of characters to Xor>
  1752.    set char=<Character to Xor with>
  1753.  
  1754.  XORs the given text  argument with the specified  character, starting
  1755.  at character number "start".   This routine will end after  "size" of
  1756.  characters have been XORed unless the second argument is another text
  1757.  argument. Then the first text argument will be XORed with the  second
  1758.  text argument until  starting at character  number "start" until  all
  1759.  characters have been used up in either the first or second arguments.
  1760.  
  1761.  For example:
  1762.  
  1763.    set start=4
  1764.    set size=23
  1765.    set char=R
  1766.    xor TextArgument
  1767.  
  1768.  will xor  the text  argument with  the letter  R starting  at the 4th
  1769.  character and will xor 23 characters altogether.
  1770. ╔═════════════════════════════════════════════════════════════════════╗
  1771. ║ XYZ COMPILE TIME ERROR MESSAGES:                                    ║
  1772. ╚═════════════════════════════════════════════════════════════════════╝
  1773.  "Error on line number ##"
  1774.    Shows on which line in the source file that the error occurred. 
  1775.    Line number 0 is the command line. 
  1776.  "...unable to open file!"
  1777.    Possibly the wrong file name was typed in on the DOS command line.
  1778.  "...file must start with numeric size!"
  1779.    All XYZ source files start with a number. See the topic titled
  1780.    "Sample programs to compile" for an example.
  1781.  "...incorrect use of XYZ command!"
  1782.    Usually a reserved argument was misspelled or missing.
  1783.  "...nonexistent argument was given!"
  1784.    An argument was expected but there was none. Check syntax for that
  1785.    command.
  1786.  "...argument must be numeric!"
  1787.  "...argument must be text!"
  1788.  "...nonexistent label was given!"
  1789.    The label called out for wasn't found.
  1790.  "...argument types don't match!"
  1791.    Arguments must both be numeric or text or reserved.
  1792.  "...file size greater that 64k!"
  1793.    Maximum size of an XYZ program is 64k.
  1794.  "...too many characters on the command line!"
  1795.    Maximum number of characters per line in the source file is 111
  1796.    characters.
  1797.  "...argument must be a label!"
  1798.  "...argument must equal 25, 43, or 50!"
  1799.  "...nonexistent command was given!"
  1800.    Usually a command was misspelled or missing.
  1801. ╔═════════════════════════════════════════════════════════════════════╗
  1802. ║ Reporting bugs or giving advice                                     ║
  1803. ╚═════════════════════════════════════════════════════════════════════╝
  1804.  You  do  not  have  to  be  a  registered user to report bugs or give
  1805.  advice.  Any  input you give  to me will  be appreciated, although  I
  1806.  probably won't  be able  to respond  to you  personally, depending on
  1807.  the number of  responses I get.  The kind of  advice I would  like to
  1808.  see would be something like:
  1809.  
  1810.    How to make the programs more readable
  1811.    How to explain a command simpler
  1812.    New commands to make XYZ easier or more convenient
  1813.    And so on...
  1814.  
  1815.  Please send your comments to:
  1816.  
  1817.    XYZ
  1818.    PO BOX #40943
  1819.    Tempe, AZ 85274
  1820.  
  1821.  You can also leave comments on the Internet at xyz@netzone.com
  1822.  
  1823.  Some examples of some ideas that have already been suggested are:
  1824.  
  1825.    Add complex number calculation capability
  1826.    Make dat statements that can do arrays
  1827.    Enable extended memory to be usable for storing data
  1828.  
  1829.  If enough people respond, I will implement these suggestions with the
  1830.  next release of XYZ.
  1831. ╔═════════════════════════════════════════════════════════════════════╗
  1832. ║ Controlling the flow of code                                        ║
  1833. ╚═════════════════════════════════════════════════════════════════════╝
  1834.  For my next trick, I am going teach you how to train your program  to
  1835.  jump through  loops and  do other  things at  your bidding.  The most
  1836.  important part of the code you  write is going to be centered  around
  1837.  three things: loops, jumps, and calls. Most programs you will see are
  1838.  always  doing  something  even  when  they  appear  to  not  be doing
  1839.  anything.  What  they are doing  is waiting for  the user to  press a
  1840.  key or click  a mouse button.  The computer "waits"  by doing a  loop
  1841.  and continously checking for input from the user. What is a loop  and
  1842.  how do I make one? Glad you asked...here is a typical loop:
  1843.  
  1844.    dat txt 01 "Q"_Character=Q
  1845.    dat txt Prompt=Type a key (Q=quit)
  1846.    dat txt Text
  1847.    set color=0A 00 00
  1848.    set size=1
  1849.    set start=1
  1850.    set start2=1
  1851.    --- Loop ────────────────┐
  1852.    tty Prompt                │
  1853.    input Text                │
  1854.    cmp Text to "Q"_Character │
  1855.    jne Loop ────────────────┘
  1856.    end with 1
  1857.  
  1858.  This loop  does "nothing"  but continuously  prompt your  end user to
  1859.  type an key. Not until the user types a Q, will the program end.  Not
  1860.  very useful but it does illustrate  what a loop is. The key  parts to
  1861.  a loop are the jump instruction and the label. You will have to  make
  1862.  many loops for  your your program  to function well  so it can  check
  1863.  many things  such as  keyboard status  and mouse  stautus among other
  1864.  things.
  1865.  
  1866.  Sometimes, you will have to make a decision about what you want  your
  1867.  program to do next depending on  what your user wants to do  next. At
  1868.  that point you  will need to  branch or jump  to another part  of the
  1869.  program and  continue operating  from there  before returning  to the
  1870.  starting code.
  1871.  
  1872.    --- Loop ─────────────────────────┐
  1873.    input Text                │         │
  1874.    cmp Text to "Q"_Character │         │
  1875.    jeq EndProgram            │         │
  1876.    cmp Text to "C"_Character │         │
  1877.    jeq Function#1            │         │
  1878.    cmp Text to "D"_Character │         │
  1879.    jne Loop ────────────────┘         │
  1880.    --- ContinueHere ────────────────┐ │
  1881.    call Function#2                   │ │
  1882.    jmp Loop ────────────────────────│─┘
  1883.    --- Function#1                    │
  1884.    mul Firstnumber with Secondnumber │
  1885.    jmp ContinueHere ────────────────┘
  1886.    --- Function#2
  1887.    draw line
  1888.    ret ...return to the line following the command that called us
  1889.    --- EndProgram
  1890.    end with 1
  1891.  
  1892.  Notice the  two ways  that a  function can  be used.  Function#1 ends
  1893.  with a jmp instruction  and if it is  used, it will always  return to
  1894.  the same place (ContinueHere). If  the "call" command is used  to use
  1895.  a function  that ends  with a  "ret" command,  then ANY  part of  the
  1896.  program that calls it will return where it left off.
  1897.  
  1898.  Another thing that you might want to do with loops is to cycle 
  1899.  through a loop for a certain amount of times before exiting.
  1900.  
  1901.    dat txt HiWorld=Hello World!
  1902.        
  1903.    set usr1=5
  1904.    set color=0A 00 00
  1905.    set start=1
  1906.    set size=14
  1907.    --- Loop ──┐
  1908.    tty HiWorld │
  1909.    dec usr1    │
  1910.    jne Loop ──┘
  1911.    end with 1
  1912.  
  1913.  This segment of code will loop until usr1=0 (hence the jne, which  is
  1914.  used without a "cmp" command, is the equivalent of jump if not  equal
  1915.  to  zero).  In  other  words,  it  will print out "Hello World!" five
  1916.  times before quitting.
  1917. ╔═════════════════════════════════════════════════════════════════════╗
  1918. ║ Sample programs to compile                                          ║
  1919. ╚═════════════════════════════════════════════════════════════════════╝
  1920.  The general outline of a typical XYZ file is as follows:
  1921.  
  1922.    000 General Outline:
  1923.    dat mouse XXXX
  1924.    dat num XXXX
  1925.    dat txt XXXX
  1926.    .
  1927.    .
  1928.    .
  1929.    source code
  1930.    /// Don't forget comments!
  1931.    .
  1932.    .
  1933.    .
  1934.    end with XX (could be anywhere in the file)
  1935.    eof
  1936.    Additional documentation may be added here.
  1937.  
  1938.  Now for a short explanation:
  1939.  
  1940.    1. The first line  must start with a  three digit number that  will
  1941.       determine how  many digits  will display  for calculations  done
  1942.      with the math functions.
  1943.  
  1944.    2. Next,  all data  that will  be used  in the  program needs to be
  1945.       initialized or defined.
  1946.  
  1947.    3. After all data has  been defined or initialized, then  comes the
  1948.       "meat" of the program, which is your main program.
  1949.  
  1950.    4. The  best  way  to  quit  you  programs is with a "end with  XX"
  1951.       command  where  XX  equals  a  number  from  0  to  255. You can
  1952.      optionally end your program with  a "ret" command (if no  "call"
  1953.      or  "push"  commands  were  used  prior  to the "ret" command is
  1954.      called) but it is not recommended.
  1955.  
  1956.    5. At the end of all of your SOURCE CODE, I would highly  recommend
  1957.       that you type the word "eof". XYZ will end it's compilation  and
  1958.      totally ignore any  text that you  add on the  next line or  any
  1959.      line thereafter. This may be a good way to add documentation  to
  1960.      your  program  without  having  to  keep  it in a seperate file.
  1961.  
  1962.    6. You should thoroughly add comments to you source code wherever 
  1963.       possible.
  1964.       
  1965.  Here are  the few  sample programs  I mentioned  earlier: Copy  these
  1966.  sample programs  to a  separate file  and compile  them with  the XYZ
  1967.  compiler. Some programs may need to be edited to fit in less than  30
  1968.  lines  of  source  code,  IF  you  are  compiling  with the shareware
  1969.  version of XYZ.
  1970.  
  1971.    000 This is a sample test file for various mouse cursors
  1972.    /// The compiled version of this program can be found
  1973.    /// under the name "rat.com" in this directory.
  1974.    dat mouse GunSight 0007 0007
  1975.    dat ....** . **.....
  1976.    dat ..**   .   **...
  1977.    dat .**    .    **..
  1978.    dat .*     .     *..
  1979.    dat *      .      *.
  1980.    dat *      .      *.
  1981.    dat        .       .
  1982.    dat ................
  1983.    dat        .       .
  1984.    dat *      .      *.
  1985.    dat *      .      *.
  1986.    dat *      .      *.
  1987.    dat .*     .     *..
  1988.    dat .**    .    **..
  1989.    dat ..**   .   **...
  1990.    dat ....** . **.....
  1991.    dat mouse crosshair 0006 0006
  1992.    dat ......*.........
  1993.    dat .....*o*........
  1994.    dat .....*o*........
  1995.    dat .....*o*........
  1996.    dat .....*o*........
  1997.    dat .*****.*****....
  1998.    dat *oooo...oooo*...
  1999.    dat .*****.*****....
  2000.    dat .....*o*........
  2001.    dat .....*o*........
  2002.    dat .....*o*........
  2003.    dat .....*o*........
  2004.    dat ......*.........
  2005.    dat ................
  2006.    dat ................
  2007.    dat ................
  2008.    dat mouse downarrow 0015 0005
  2009.    dat ...*****........
  2010.    dat ...*ooo*........
  2011.    dat ...*ooo*........
  2012.    dat ...*ooo*........
  2013.    dat ...*ooo*........
  2014.    dat ...*ooo*........
  2015.    dat ...*ooo*........
  2016.    dat ...*ooo*........
  2017.    dat ...*ooo*........
  2018.    dat ...*ooo*........
  2019.    dat ****ooo****.....
  2020.    dat *ooooooooo*.....
  2021.    dat .*ooooooo*......
  2022.    dat ..*ooooo*.......
  2023.    dat ...*ooo*........
  2024.    dat ....*o*.........
  2025.    dat mouse lefthand 0005 0001
  2026.    dat ................
  2027.    dat ................
  2028.    dat ......ooooooooo.
  2029.    dat ......o********o
  2030.    dat oooooooooo*****o
  2031.    dat o**************o
  2032.    dat ooooooooo******o
  2033.    dat ....o**********o
  2034.    dat ....ooooo******o
  2035.    dat ....o**********o
  2036.    dat ....ooooo******o
  2037.    dat .....o********oo
  2038.    dat .....oooooooooo.
  2039.    dat ................
  2040.    dat ................
  2041.    dat ................
  2042.    dat mouse hourglass 0007 0007
  2043.    dat .*************..
  2044.    dat *ooooooooooooo*.
  2045.    dat .*o*********o*..
  2046.    dat .*o*********o*..
  2047.    dat ..*o*o*o*o*o*...
  2048.    dat ...*o*o*o*o*....
  2049.    dat ....*o*o*o*.....
  2050.    dat ....*o***o*.....
  2051.    dat ..**o**o**o**...
  2052.    dat ..*o*******o*...
  2053.    dat .*o****o****o*..
  2054.    dat .*o***o*o***o*..
  2055.    dat *ooooooooooooo*.
  2056.    dat .*************..
  2057.    dat ................
  2058.    dat ................
  2059.    set videomode=12 ...which is the 640x480x16 color mode
  2060.    mouse cursor=GunSight
  2061.    mouse show
  2062.    int 16 ax=0000 is the BIOS wait for keypress function
  2063.    mouse hide
  2064.    mouse cursor=crosshair
  2065.    mouse show
  2066.    int 16 ax=0000
  2067.    mouse hide
  2068.    mouse cursor=downarrow
  2069.    mouse show
  2070.    int 16 ax=0000
  2071.    mouse hide
  2072.    mouse cursor=lefthand
  2073.    mouse show
  2074.    int 16 ax=0000
  2075.    mouse hide
  2076.    mouse cursor=hourglass
  2077.    mouse show
  2078.    int 16 ax=0000
  2079.    mouse hide
  2080.    end with 1
  2081.    eof
  2082.  
  2083.  This next example  file demonstrates a  few of the  functions of XYZ.
  2084.  Notice how small this file  compiles! How many compilers do  you know
  2085.  of that would  perform the same  functions as this  one in only  5885
  2086.  bytes? Enjoy...
  2087.  
  2088.    053 This is a demonstration file
  2089.    /// The compiled version of this file can be found
  2090.    /// under the name "sample.com" in this directory.
  2091.    dat txt sample.xyz=xyz101s.doc
  2092.    dat txt $tring=The sin of 2 = 
  2093.    dat txt error=
  2094.        File not found!
  2095.    dat num number=2
  2096.    /// Demonstrate graphics
  2097.    set videomode=12 which is the 640x480x16 color mode
  2098.    set wide=100
  2099.    set hite=200
  2100.    set color=0B 00 00 = bright blue
  2101.    set angle=-45 degrees
  2102.    set mode=0
  2103.    set col=320
  2104.    set row=240
  2105.    draw rotated ellipse
  2106.    set blank=3
  2107.    set dash1=3
  2108.    set dash2=6
  2109.    /// This sets row2=row...
  2110.    push row
  2111.    pop row2
  2112.    set col2=639
  2113.    draw line
  2114.    int 16 ax=0000 This interrupt will pause until a key is pressed
  2115.    set videomode=3 which is normal text mode
  2116.    /// Demonstrate math capability
  2117.    set color=0A 00 00 = bright green
  2118.    set start=1
  2119.    set size=20
  2120.    tty $tring
  2121.    sin number
  2122.    convert result to buffer
  2123.    tty buffer
  2124.    /// Demonstrate file command
  2125.    file open sample.xyz
  2126.    jer Error!
  2127.    /// I could have set up a Critical Error Handler instead of "jer"
  2128.    set size=27
  2129.    file read from handle to buffer
  2130.    set col=0
  2131.    set row=1
  2132.    set tty cursor
  2133.    tty buffer
  2134.    file reset handle
  2135.    set size=27
  2136.    file read from handle to buffer
  2137.    set mode=1
  2138.    set tty blink to enable a blinking cursor
  2139.    set col=0
  2140.    set row=2
  2141.    set color=8A 00 00 = blinking bright green
  2142.    set tty cursor
  2143.    tty buffer
  2144.    file close handle
  2145.    end with 0
  2146.    --- Error! ...the program will go here if xyz101s.doc not found.
  2147.    set size=25
  2148.    set mode=1
  2149.    set tty blink to enable a blinking cursor
  2150.    set color=8C 00 00 = blinking bright red
  2151.    tty error
  2152.    end with 255
  2153.    eof
  2154. ╔═════════════════════════════════════════════════════════════════════╗
  2155. ║ Becoming a registered user                                          ║
  2156. ╚═════════════════════════════════════════════════════════════════════╝
  2157.  If you have enjoyed  using XYZ, then you  are welcome to register  it
  2158.  for $30. This $30 will enable  you to use it to compile  and register
  2159.  your  own  programs  for  fun  or  profit.  Without this registration
  2160.  process, any programs you compile with it remain the property of  the
  2161.  owner(s) of the XYZ software application product. See the topic  "XYZ
  2162.  License Agreement" for more information.
  2163.  
  2164.  Please send your registration fee to:
  2165.  
  2166.    XYZ
  2167.    PO BOX #40943
  2168.    Tempe, AZ 85274
  2169.  
  2170.  Make check(s) payable to: Andrew Robinson
  2171.  
  2172.  Soon to be released are:
  2173.  
  2174.    * A 32-bit version of XYZ
  2175.    * An XYZ debugger for troubleshooting your compiled programs
  2176.    * A Windows95 compiler written as an XYZ application
  2177.  
  2178.  For Corporate registrations, the registration fee  will be $300.  For
  2179.  international corporate registrations,  the registration fee  will be
  2180.  $1000.
  2181.  
  2182.  Windows95 is a trademark of Microsoft Corp.
  2183. ╔═════════════════════════════════════════════════════════════════════╗
  2184. ║ APPENDIX:                                                           ║
  2185. ╚═════════════════════════════════════════════════════════════════════╝
  2186. ┌─────────────────────────────────────────────────────────────────────┐
  2187. │ Table of Scan Codes for 101/102-Key Keyboard (in hexadecimal):      │
  2188. └─────────────────────────────────────────────────────────────────────┘
  2189.  Main keyboard:
  2190.  ┌───┐┌──┬──┬──┬──┐┌──┬──┬──┬──┐┌──┬───┬───┬───┐┌───┬───┬───┐
  2191.  │Esc││F1│F2│F3│F4││F5│F6│F7│F8││F9│F10│F11│F12││Prt│Scl│Paw│
  2192.  │ 01││3B│3C│3D│3E││3F│40│41│42││43│ 44│ 57│ 58││   │ 57│   │
  2193.  └───┘└──┴──┴──┴──┘└──┴──┴──┴──┘└──┴───┴───┴───┘└───┴───┴───┘
  2194.  ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──────┐┌───┬───┬───┐
  2195.  │` │ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│ 9│ 0│ -│ =│──   ││Ins│Hom│PgU│
  2196.  │29│02│03│04│05│06│07│08│09│0A│0B│0C│0D│ 0E   ││*52│*47│*49│
  2197.  ├──┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─────┤├───┼───┼───┤
  2198.  │Tab│ Q│ W│ E│ R│ T│ Y│ U│ I│ O│ P│ [│ ]│     ││Del│End│PgD│
  2199.  │ 0F│10│11│12│13│14│15│16│17│18│19│1A│1B│     ││*53│*4F│*51│
  2200.  ├───┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┘     │└───┴───┴───┘
  2201.  │Caps│ A│ S│ D│ F│ G│ H│ J│ K│ L│ ;│ '│ ENTER │
  2202.  │ 3A │1E│1F│20│21│22│23│24│25│26│27│28│ 1C ─┘│
  2203.  ├────┴─┬┴─┬┴─┬┴─┬┴─┬┴─┬┴─┬┴─┬┴─┬┴─┬┴─┬┴────┬──┤┌───┐
  2204.  │Shift │ Z│ X│ C│ V│ B│ N│ M│ ,│ .│ /│Shift│\ ││  │
  2205.  │  2A  │2C│2D│2E│2F│30│31│32│33│34│35│  36 │2B││*48│
  2206.  ├────┬─┴┬─┴──┼──┴──┴──┴──┴──┴──┴┬─┴──┼───┬─┴──┤┌───┼───┼───┐
  2207.  │Ctrl│  │Alt │     Space Bar    │Alt │   │Ctrl││  │  │  │
  2208.  │ 1D │  │ 38 │        39        │*38 │   │*10 ││*4B│*50│*40│
  2209.  └────┘  └────┴──────────────────┴────┘   └────┘└───┴───┴───┘
  2210.  
  2211.  Numeric keypad:
  2212.  ┌───┬───┬───┬───┐
  2213.  │Num│ / │ * │ - │
  2214.  │ 45│*36│ 37│ 4A│
  2215.  ├───┼───┼───┼───┤
  2216.  │ 7 │ 8 │ 9 │   │
  2217.  │ 47│ 48│ 49│ + │
  2218.  ├───┼───┼───┤ 4E│
  2219.  │ 4 │ 5 │ 6 │   │
  2220.  │ 4B│ 4C│4D │   │
  2221.  ├───┼───┼───┼───┤
  2222.  │ 1 │ 2 │ 3 │   │
  2223.  │ 4F│ 50│ 51│─┘│  Notes:
  2224.  ├───┴───┼───┤*1C│  * = E0
  2225.  │  Ins  │Del│   │  Prt = E0 2A E0 37
  2226.  │   52  │ 53│   │  Paw (pause) = E0 10 45
  2227.  └───────┴───┴───┘  Scan Codes for 84 or 83-Key Keyboards are the same.
  2228.  
  2229. ┌─────────────────────────────────────────────────────────────────────┐
  2230. │ Table of video modes and their default colors:                      │
  2231. └─────────────────────────────────────────────────────────────────────┘
  2232.  
  2233.  For sixteen color video/text modes:
  2234.  
  2235.  ┌──────────────────┬──────────────────┐
  2236.  │ Background   Hex │Foreground   Hex  │
  2237.  │ Color       Value│ Color      Value │
  2238.  ├──────────────────┼──────────────────┤
  2239.  │ Black         0  │ Black         0  │
  2240.  │ Blue          1  │ Blue          1  │
  2241.  │ Green         2  │ Green         2  │
  2242.  │ Cyan          3  │ Cyan          3  │
  2243.  │ Red           4  │ Red           4  │
  2244.  │ Magenta       5  │ Magenta       5  │
  2245.  │ Brown         6  │ Brown         6  │
  2246.  │ White         7  │ White         7  │
  2247.  │ Black blink   8  │ Dark gray     8  │
  2248.  │ Blue blink    9  │ Light blue    9  │
  2249.  │ Green blink   A  │ Light green   A  │
  2250.  │ Cyan blink    B  │ Light cyan    B  │
  2251.  │ Red blink     C  │ Light red     C  │
  2252.  │ Magenta blink D  │ Light magenta D  │
  2253.  │ Brown blink   E  │ Yellow        E  │
  2254.  │ White blink   F  │ Bright white  F  │
  2255.  └──────────────────┴──────────────────┘
  2256.  
  2257.  Some sample colors for the 16.8M color modes:
  2258.  
  2259.  Black     = 00 00 00
  2260.  Blue      = 00 00 FF
  2261.  Brown     = 7F 29 29
  2262.  Chocolate = D1 69 1E
  2263.  Cyan      = 00 FF FF
  2264.  Flesh     = FF 7D 40
  2265.  Gold      = FF D7 00
  2266.  Green     = 00 64 00
  2267.  Grey      = 6F 6F 6F
  2268.  Hotpink   = FF 6A 64
  2269.  Indigo    = 08 2E 54
  2270.  Ivory     = FF FF F0
  2271.  Lightgrey = D3 D3 D3
  2272.  Magenta   = FF 00 FF
  2273.  Maroon    = 60 2F 60
  2274.  Olive     = 3B 5E 2B
  2275.  Orange    = FF 80 00
  2276.  Purple    = A0 20 F0
  2277.  Red       = FF 00 00
  2278.  Skyblue   = 87 CE FA
  2279.  Tan       = D2 64 8C
  2280.  Turquoise = 40 E0 D0
  2281.  Violet    = 8E 5E 99
  2282.  White     = FF FF FF
  2283.  Yellow    = FF FF 00
  2284.  
  2285. ┌─────────────────────────────────────────────────────────────────────┐
  2286. │ Table of ASCII codes:                                               │
  2287. └─────────────────────────────────────────────────────────────────────┘
  2288.  
  2289.    ┌───────────────────────────────────────────────────────────────┐
  2290.    │  0 Nul   32 BL   64 @    96 `   128 Ç   160 á   192 └   224 α │
  2291.    │  1      33 !    65 A    97 a   129 ü   161 í   193 ┴   225 ß │
  2292.    │  2      34 "    66 B    98 b   130 é   162 ó   194 ┬   226 Γ │
  2293.    │  3      35 #    67 C    99 c   131 â   163 ú   195 ├   227 π │
  2294.    │  4      36 $    68 D   100 d   132 ä   164 ñ   196 ─   228 Σ │
  2295.    │  5      37 %    69 E   101 e   133 à   165 Ñ   197 ┼   229 σ │
  2296.    │  6      38 &    70 F   102 f   134 å   166 ª   198 ╞   230 µ │
  2297.    │  7      39 '    71 G   103 g   135 ç   167 º   199 ╟   231 τ │
  2298.    │  8      40 (    72 H   104 h   136 ê   168 ¿   200 ╚   232 Φ │
  2299.    │  9 TAB   41 )    73 I   105 i   137 ë   169 ⌐   201 ╔   233 Θ │
  2300.    │ 10 LF    42 *    74 J   106 j   138 è   170 ¬   202 ╩   234 Ω │
  2301.    │ 11       43 +    75 K   107 k   139 ï   171 ½   203 ╦   235 δ │
  2302.    │ 12 FF    44 ,    76 L   108 l   140 î   172 ¼   204 ╠   236 ∞ │
  2303.    │ 13 CR    45 -    77 M   109 m   141 ì   173 ¡   205 ═   237 φ │
  2304.    │ 14      46 .    78 N   110 n   142 Ä   174 «   206 ╬   238 ε │
  2305.    │ 15      47 /    79 O   111 o   143 Å   175 »   207 ╧   239 ∩ │
  2306.    │ 16      48 0    80 P   112 p   144 É   176 ░   208 ╨   240 ≡ │
  2307.    │ 17      49 1    81 Q   113 q   145 æ   177 ▒   209 ╤   241 ± │
  2308.    │ 18      50 2    82 R   114 r   146 Æ   178 ▓   210 ╥   242 ≥ │
  2309.    │ 19      51 3    83 S   115 s   147 ô   179 │   211 ╙   243 ≤ │
  2310.    │ 20      52 4    84 T   116 t   148 ö   180 ┤   212 ╘   244 ⌠ │
  2311.    │ 21      53 5    85 U   117 u   149 ò   181 ╡   213 ╒   245 ⌡ │
  2312.    │ 22      54 6    86 V   118 v   150 û   182 ╢   214 ╓   246 ÷ │
  2313.    │ 23      55 7    87 W   119 w   151 ù   183 ╖   215 ╫   247 ≈ │
  2314.    │ 24      56 8    88 X   120 x   152 ÿ   184 ╕   216 ╪   248 ° │
  2315.    │ 25      57 9    89 Y   121 y   153 Ö   185 ╣   217 ┘   249 ∙ │
  2316.    │ 26      58 :    90 Z   122 z   154 Ü   186 ║   218 ┌   250 · │
  2317.    │ 27      59 ;    91 [   123 {   155 ¢   187 ╗   219 █   251 √ │
  2318.    │ 28      60 <    92 \   124 |   156 £   188 ╝   220 ▄   252 ⁿ │
  2319.    │ 29      61 =    93 ]   125 }   157 ¥   189 ╜   221 ▌   253 ² │
  2320.    │ 30      62 >    94 ^   126 ~   158 ₧   190 ╛   222 ▐   254 ■ │
  2321.    │ 31      63 ?    95 _   127    159 ƒ   191 ┐   223 ▀   255 BL│
  2322.    └───────────────────────────────────────────────────────────────┘
  2323.  
  2324.  Notes:
  2325.  All codes are in decimal.
  2326.  BL = Blank
  2327.  LF = line feed (goto next line)
  2328.  FF = form feed (goto next page)
  2329.  CR = carriage return (goto first char on current line)
  2330.  TAB = goto next tab stop
  2331.  
  2332. ┌─────────────────────────────────────────────────────────────────────┐
  2333. │ List of some common DOS 21h interrupts:                             │
  2334. └─────────────────────────────────────────────────────────────────────┘
  2335.  Auxiliary input
  2336.    Call with: AX=0300h
  2337.    Returns  : AL=ASCII code for character
  2338.  ----------------------------------------------------------------------
  2339.  Auxiliary output
  2340.    Call with: AX=0400h
  2341.               DL=ASCII code for character
  2342.  ----------------------------------------------------------------------
  2343.  Character input with buffer
  2344.    Call with: AX=0A00h
  2345.               DS:DX=segment:offset of buffer
  2346.  ----------------------------------------------------------------------
  2347.  Character input without buffer (clears buffer)
  2348.    Call with: AX=0C01h or
  2349.               AX=0C06h or
  2350.               AX=0C07h or
  2351.               AX=0C08h or
  2352.               AX=0C0Ah
  2353.    Returns  : If AL not=0C0Ah
  2354.                 AL=ASCII code for character
  2355.               If AL=0C0Ah
  2356.                 DS:DX=segment:offset of input buffer
  2357.  ----------------------------------------------------------------------
  2358.  Character input with echo
  2359.    Call with: AX=0100h
  2360.    Returns  : AL=ASCII code for character
  2361.  ----------------------------------------------------------------------
  2362.  Character input without echo (unfiltered)
  2363.    Call with: AX=0700h
  2364.    Returns  : AL=ASCII code for character
  2365.  ----------------------------------------------------------------------
  2366.  Character input without echo
  2367.    Call with: AX=0800h
  2368.    Returns  : AL=ASCII code for character
  2369.  ----------------------------------------------------------------------
  2370.  Character output
  2371.    Call with: AX=0200h
  2372.               DL=ASCII code for character
  2373.  ----------------------------------------------------------------------
  2374.  Character string, Output
  2375.    Call with: AX=0900h
  2376.               DS:DX=segment:offset of string
  2377.  ----------------------------------------------------------------------
  2378.  Check input status
  2379.    Call with: AX=0B00h
  2380.    Returns  : If no character is available AL=00h
  2381.               If at least one character is available AL=FFh
  2382.  ----------------------------------------------------------------------
  2383.  Create new Program Segment Prefix (PSP)
  2384.    Call with: AX=2600h
  2385.    Returns  : DX=Segment of new program segment prefix
  2386.  ----------------------------------------------------------------------
  2387.  Direct console I/O
  2388.    Call with: AX=0600h
  2389.               DX=0000h-00FEh (if output request)
  2390.               DX=00FFh (if input request)
  2391.    Returns  : If called with DL=00FFh and a character is ready:
  2392.                 Zero flag=clear
  2393.                 AL=ASCII code for character
  2394.               If called with DL=00FFh and no character is ready
  2395.                 Zero flag=set
  2396.  ----------------------------------------------------------------------
  2397.  Disk, Get allocation information about
  2398.    Call with: AX=3600h
  2399.               DX=Drive code (0000=default, 0001=A,...)
  2400.    Returns  : If drive valid...
  2401.                 AX=Sectors per cluster
  2402.                 BX=Number of available clusters
  2403.                 CX=Bytes per sector
  2404.                 DX=Clusters per drive
  2405.               If drive invalid AX=FFFFh
  2406.  ----------------------------------------------------------------------
  2407.  Disk, Get current
  2408.    Call with: AX=1900h
  2409.    Returns  : AL=Drive code (0=A, 1=B,...)
  2410.  ----------------------------------------------------------------------
  2411.  Disk, Get data on
  2412.    Call with: AX=1B00h for default drive
  2413.    Returns  : If invalid drive or critical error AL=FFh
  2414.               Else AL=Sectors per cluster
  2415.                    DS:BX=segment:offset of media ID byte
  2416.                    CX=Size of physical sector (bytes)
  2417.                    DX=Number of clusters for default drive
  2418.  ----------------------------------------------------------------------
  2419.  Disk, Read sector from (Interrupt 25h, ignoring logical structure)
  2420.    Call with: AX=Drive number (0000=A, 0001=B,...)
  2421.               DX=Starting sector number
  2422.               If partitions <= 32 megabytes
  2423.                 CX=Number of sectors to read and
  2424.                 DS:BX=segment:offset of buffer
  2425.               If partitions > 32 megabytes [Version 4.0+]
  2426.                 CX=-1 and
  2427.                 DS:BX=segment:offset of parameter block
  2428.    Returns  : If function successful Carryflag=clear
  2429.               If function unsuccessful
  2430.                 Carry flag=set
  2431.                 AX=Error code
  2432.  ----------------------------------------------------------------------
  2433.  Disk, Reset
  2434.    Call with: AX=0D00h
  2435.  ----------------------------------------------------------------------
  2436.  Disk, Select
  2437.    Call with: AH=0Eh
  2438.               AL=Number of logical drives in system
  2439.               DX=Drive code (0000=A, 0001=B,...)
  2440.  ----------------------------------------------------------------------
  2441.  Disk, Write sector to (Interrupt 26h, ignoring logical structure)
  2442.    Call with: AX=Drive number (0000=A, 0001=B,...)
  2443.               DX=Starting sector number
  2444.               If partitions <= 32 megabytes
  2445.                 CX=Number of sectors to write and
  2446.                 DS:BX=segment:offset of buffer
  2447.               If partitions > 32 megabytes [Version 4.0+]
  2448.                 CX=-1 and
  2449.                 DS:BX=segment:offset of parameter block
  2450.    Returns  : If function successful Carryflag=clear
  2451.               If function unsuccessful
  2452.                 Carryflag=set
  2453.                 AX=Error code
  2454.  ----------------------------------------------------------------------
  2455.  Duplicate handle
  2456.    Call with: AX=4500h
  2457.               BX=Handle to be duplicated
  2458.    Returns  : If duplicated
  2459.                 Carry flag=clear
  2460.                 AX=New handle
  2461.               If not
  2462.                 Carry flag=set
  2463.                 AX=04h or 06h Error code
  2464.  ----------------------------------------------------------------------
  2465.  Execute program
  2466.    Call with: AX=4B00h to load and execute program
  2467.               AX=4B03h to load overlay
  2468.               DS:DX=segment:offset of program specification
  2469.    Returns  : If program executed Carry flag=clear upon return
  2470.                 Note: CS:IP must be preserved
  2471.               If not
  2472.                 Carry flag=set
  2473.                 AX=01h, 02h, 03h, 05h, 08h, 0Ah, or 0Bh Error codes
  2474.  ----------------------------------------------------------------------
  2475.  File directory, Create
  2476.    Call with: AX=3900h
  2477.               DS:DX=segment:offset of ASCIIZ path name
  2478.    Returns  : If directory created Carry flag=clear
  2479.               If directory not created
  2480.                 Carry flag=set
  2481.                 AX=0003h or 0005h Error code
  2482.  ----------------------------------------------------------------------
  2483.  File directory, delete
  2484.    Call with: AX=3A00h
  2485.               DS:DX=segment:offset of ASCIIZ path name
  2486.    Returns  : If directory deleted Carry flag=clear
  2487.               If directory not deleted
  2488.                 Carry flag=set
  2489.                 AX=03h, 05h, or 10h Error code
  2490.  ----------------------------------------------------------------------
  2491.  File directory, Find first file in
  2492.    Call with: AX=4E00h
  2493.               CX=Attribute to use in search
  2494.                    1  =Read-only
  2495.                    2  =Hidden
  2496.                    4  =System
  2497.                    8  =Volume label
  2498.                    10h=Directory
  2499.                    20h=Archive
  2500.               DS:DX=segment:offset of ASCIIZ path name
  2501.    Returns  : If first file found
  2502.                 Carry flag=clear
  2503.                 Disk transfer area (DTA) will be filled in as follows:
  2504.                   Byte# 00h-14h=0 (Reserved)
  2505.                   Byte# 15h=Attribute of matched file or directory
  2506.                   Byte# 16h-17h=Packed file time
  2507.                   Byte# 18h-19h=Packed file date
  2508.                   Byte# 1Ah-1Dh=File size
  2509.                   Byte# 1Eh-2Ah=ASCIIZ filename
  2510.               If not
  2511.                 Carry flag=set
  2512.                 AX=02h, 03h, or 12h Error codes
  2513.  ----------------------------------------------------------------------
  2514.  File directory, Find next file in
  2515.    Call with: AX=4F00h
  2516.               Assumes previous call to Int 21 Function 4Eh or 4Fh
  2517.    Returns  : If next file found
  2518.                 Carry flag=clear
  2519.                 DTA filled in
  2520.               If not
  2521.                 Carry flag=set
  2522.                 AX=12h Error code
  2523.    Note     : Disk transfer area (DTA) will be filled in as follows...
  2524.                 Byte# 00h-14h=0 (Reserved)
  2525.                 Byte# 15h=Attribute of matched file or directory
  2526.                 Byte# 16h-17h=Packed file time
  2527.                 Byte# 18h-19h=Packed file date
  2528.                 Byte# 1Ah-1Dh=File size
  2529.                 Byte# 1Eh-2Ah=ASCIIZ filename
  2530.  ----------------------------------------------------------------------
  2531.  File directory, Get current
  2532.    Call with: AX=4700h
  2533.               DX=Drive code (000=default, 0001=A,...)
  2534.               DS:SI=segment:offset of 64-byte buffer
  2535.    Returns  : If successful
  2536.                 Carry flag=clear
  2537.                 buffer is filled in with full path name
  2538.               If not
  2539.                 Carry flag=set
  2540.                 AX=0Fh Error code
  2541.  ----------------------------------------------------------------------
  2542.  File directory, Set current
  2543.    Call with: AX=3B00h
  2544.               DS:DX=segment:offset of ASCIIZ path name
  2545.    Returns  : If successful Carry flag=clear
  2546.               If unsuccessful
  2547.                 Carry flag=set
  2548.                 AX=3 Error code
  2549.  ----------------------------------------------------------------------
  2550.  File, Close
  2551.    Call with: AX=3E00h
  2552.               BX=Handle
  2553.    Returns  : If file closed Carry flag=clear
  2554.               If file still open
  2555.                 Carry flay=set
  2556.                 AX=06h Error code
  2557.  ----------------------------------------------------------------------
  2558.  File, Commit (forces buffer to be written out)
  2559.    Call with: AX=6800h
  2560.               BX=Handle
  2561.    Returns  : If file commited Carry flag=clear
  2562.               If not
  2563.                 Carry flag=set
  2564.                 AX=Error code
  2565.  ----------------------------------------------------------------------
  2566.  File, Create
  2567.    Call with: AX=3C00h
  2568.               CX=File attribute...
  2569.                    1  =Read-only
  2570.                    2  =Hidden
  2571.                    4  =System
  2572.                    8  =Volume label
  2573.                    20h=Archive
  2574.               DS:DX=segment:offset of ASCIIZ path name
  2575.    Returns  : If file created
  2576.                 Carry flag=clear
  2577.                 AX=Handle
  2578.               If file not created
  2579.                 Carry flag=set
  2580.                 AX=3, 4, or 5 Error code
  2581.  ----------------------------------------------------------------------
  2582.  File, Create temporary
  2583.    Call with: AX=5A00h
  2584.               CX=Attribute
  2585.                    1  =Read-only
  2586.                    2  =Hidden
  2587.                    4  =System
  2588.                    8  =Volume label
  2589.                    20h=Archive
  2590.               DS:DX=segment:offset of ASCIIZ path name
  2591.    Returns  : If file created
  2592.                 Carry flag=clear
  2593.                 AX=Handle
  2594.                 DS:DX=segment:offset of complete ASCIIZ path name
  2595.               If not
  2596.                 AX=03h, 04h, or 05h Error codes
  2597.  ----------------------------------------------------------------------
  2598.  File, Create new
  2599.    Call with: AX=5B00h
  2600.               CX=Attribute
  2601.                    1  =Read-only
  2602.                    2  =Hidden
  2603.                    4  =System
  2604.                    8  =Volume label
  2605.                    20h=Archive
  2606.               DS:DX=segment:offset of ASCIIZ path name
  2607.    Returns  : If file created
  2608.                 Carry flag=clear
  2609.                 AX=Handle
  2610.                 DS:DX=segment:offset of complete ASCIIZ path name
  2611.               If not
  2612.                 AX=03h, 04h, 05h, or 50h Error codes
  2613.  ----------------------------------------------------------------------
  2614.  File, Delete
  2615.    Call with: AX=4100h
  2616.               DS:DX=segment:offset of ASCIIZ path name
  2617.    Returns  : If deleted Carry flag=clear
  2618.               If not deleted
  2619.                 Carry flag=set
  2620.                 AX=02h, 03h, or 05h Error code
  2621.  ----------------------------------------------------------------------
  2622.  File, Extended open, create, or replace File for DOS Version 4.0+
  2623.    Call with: AH=6C00h
  2624.               BX=Open mode
  2625.                    Access type...
  2626.                      0=read-only
  2627.                      1=write-only
  2628.                      2=read/write
  2629.                    Sharing mode...
  2630.                      0  =compatibility
  2631.                      10h=deny read/write
  2632.                      20h=deny write
  2633.                      30h=deny read
  2634.                      40h=deny none
  2635.                    Inheritance...
  2636.                      0  =child process inherits handle
  2637.                      80h=child does not inherit handle
  2638.                    Critical error handling...
  2639.                      0    =execute Int 24h
  2640.                      2000h=return error to process
  2641.                    Write-through...
  2642.                      0    =writes may be buffered and deferred
  2643.                      4000h=physical write at request time
  2644.               CX=File attribute
  2645.                    1  =read-only
  2646.                    2  =hidden
  2647.                    4  =system
  2648.                    8  =volume label
  2649.                    20h=archive
  2650.               DX=Open flag
  2651.                    Action if file exists...
  2652.                      0=fail
  2653.                      1=open file
  2654.                      2=replace file
  2655.                    Action if file doesn't exist...
  2656.                      0=fail
  2657.                      80h=create file
  2658.               DS:SI=segment:offset of ASCIIZ path name
  2659.    Returns  : If function successful
  2660.                 Carry flag=clear
  2661.                 AX=Handle
  2662.                 CX=Action taken
  2663.                      1=File existed and was opened
  2664.                      2=File did not exist and was created
  2665.               If function unsuccessful
  2666.                 Carry flag=set
  2667.                 AX=Error code
  2668.  ----------------------------------------------------------------------
  2669.  File, Get or set attributes of
  2670.    Call with: AX=4300h if getting file attribute
  2671.               AX=4301h if setting file attribute
  2672.               CX=New file attribute if AL=01h
  2673.                    1  =Read-only
  2674.                    2  =Hidden
  2675.                    4  =System
  2676.                    20h=Archive
  2677.               DS:DX=segment:offset of ASCIIZ path name
  2678.    Returns  : If file attribute set
  2679.                 Carry flag=clear
  2680.                 CX=File attribute
  2681.               If file attribute not set
  2682.                 Carry flag=set
  2683.                 AX=01h, 02h, 03h, or 05h Error code
  2684.  ----------------------------------------------------------------------
  2685.  File, Get or set date and time of
  2686.    Call with: If getting date and time
  2687.                 AX=5700h
  2688.                 BX=Handle
  2689.               If setting date and time
  2690.                 AX=5701h
  2691.                 BX=Handle
  2692.                 CX=Time
  2693.                      Bits 0Bh-0Fh=hours (0-23)
  2694.                      Bits 05h-0AH=minutes (0-59)
  2695.                      Bits 00h-04h=2-second increments (0-29)
  2696.                 DX=Date
  2697.                      Bits 09h-0Fh=year (relative to 1980)
  2698.                      Bits 05h-08h=month (1-12)
  2699.                      Bits 00h-04h=day (1-31)
  2700.    Returns  : If date and time set or got
  2701.                 Carry flag=clear
  2702.                 CX=Time
  2703.                 DX=Date
  2704.               If not
  2705.                 Carry flag=set
  2706.                 AX=01h or 06h Error codes
  2707.  ----------------------------------------------------------------------
  2708.  File, Lock or unlock region of
  2709.    Call with: AX=5C00h if locking region
  2710.               AX=5C01h if unlocking region
  2711.               BX=Handle
  2712.               CX=High part of region offset
  2713.               DX=Low part of region offset
  2714.               SI=High part of region length
  2715.               DI=Low part of region length
  2716.    Returns  : If file created
  2717.                   Carry flag=clear
  2718.               If not
  2719.                 Carry flag=set
  2720.                 AX=01h, 06h, 21h, or 24h Error codes
  2721.  ----------------------------------------------------------------------
  2722.  File, Open
  2723.    Call with: AH=3Dh
  2724.               AL=Access mode...
  2725.                    0=read access
  2726.                    1=write access
  2727.                    2=read/write access
  2728.                  Sharing mode...
  2729.                    0  =compatibility mode
  2730.                    10h=deny all
  2731.                    20h=deny write
  2732.                    30h=deny read
  2733.                    40h=deny none
  2734.                  Inheritance flag...
  2735.                    0  =Child process inherits handle
  2736.                    80h=Child does not inherit handle
  2737.               DS:DX=segment:offset of ASCIIZ path name
  2738.    Returns  : If file opened
  2739.                 Carry flag=clear
  2740.                 AX=Handle
  2741.               If file unopened
  2742.                 Carry flag=set
  2743.                 AX=2, 3, 4, 5, or 0Ch Error code
  2744.  ----------------------------------------------------------------------
  2745.  File, Rename
  2746.    Call with: AX=5600h
  2747.               DS:DX=segment:offset of current ASCIIZ path name
  2748.               ES:DI=segment:offset of new ASCIIZ path name
  2749.    Returns  : If file renamed Carry flag=clear
  2750.               If not
  2751.                 Carry flag=set
  2752.                 AX=02h, 03h, 05h, or 11h Error codes
  2753.  ----------------------------------------------------------------------
  2754.  File, Set handle count (sets maximum number of files)
  2755.    Call with: AX=6700h
  2756.               BX=Number of desired handles
  2757.    Returns  : If handle count set Carry flag=clear
  2758.               If not
  2759.                 Carry flag=set
  2760.                 AX=Error code
  2761.  ----------------------------------------------------------------------
  2762.  File, Set location of pointer in
  2763.    Call with: AX=4200h Absolute offset from start of file
  2764.               AX=4201h Signed offset from current file pointer
  2765.               AX=4202h Signed offset from end of file
  2766.               BX=Handle
  2767.               CX=Most significant half of offset to move
  2768.               DX=Least significant half of offset to move
  2769.    Returns  : If file pointer set
  2770.                 Carry flag=clear
  2771.                 AX=Least significant half of resulting file pointer
  2772.                 DX=Most significant half of resulting file pointer
  2773.               If file pointer not set
  2774.                 Carry flag=set
  2775.                 AX=01h or 06h Error code
  2776.  ----------------------------------------------------------------------
  2777.  File or device, Read from
  2778.    Call with: AX=3F00h
  2779.               BX=Handle
  2780.               CX=Number of bytes to read
  2781.               DS:DX=segment:offset of buffer
  2782.    Returns  : If read
  2783.                 Carry flag=clear
  2784.                 AX=Number of bytes read
  2785.               If not read
  2786.                 Carry flag=set
  2787.                 AX=05h or 06h Error code
  2788.  ----------------------------------------------------------------------
  2789.  File or device, Write to
  2790.    Call with: AX=4000h
  2791.               BX=Handle
  2792.               CX=Number of bytes to write
  2793.               DS:DX=segment:offset of buffer
  2794.    Returns  : If written
  2795.                 Carry flag=clear
  2796.                 AX=Number of bytes written
  2797.               If not written
  2798.                 Carry flag=set
  2799.                 AX=05h or 06h Error code
  2800.  ----------------------------------------------------------------------
  2801.  Get Data Transfer Area (DTA) address
  2802.    Call with: AX=2F00h
  2803.    Returns  : ES:BX=segment:offset of DTA
  2804.  ----------------------------------------------------------------------
  2805.  Get Date
  2806.    Call with: AX=2A00h
  2807.    Returns  : CX=Year (1980 through 2099)
  2808.               DH=Month (1 through 12)
  2809.               DL=Day (1 through 31)
  2810.               AL=Day of the week (0=Sunday, 1=Monday,...)
  2811.  ----------------------------------------------------------------------
  2812.  Get Extended Country Information
  2813.    Call with: AX=6502h to get pointer to Uppercase Table
  2814.               AX=6504h to get pointer to Filename Uppercase Table
  2815.               AX=6506h to get pointer to Collating Table
  2816.               AX=6507h to get pointer to DBCS Vector [Version 4.0+]
  2817.               BX=Code page of interest (-1=active CON device)
  2818.               CX=Length of buffer to receive information
  2819.               DX=Country ID (-1=default)
  2820.               ES:DI=Address of buffer to receive information
  2821.    Returns  : If file created
  2822.                 Carry flag=clear
  2823.               If not
  2824.                 Carry flag=set
  2825.                 AX=02h Error code
  2826.  ----------------------------------------------------------------------
  2827.  Get Extended Error Information
  2828.    Call with: AH=59h
  2829.               BX=00h
  2830.    Returns  : AX=Extended error code
  2831.               BH=Error class...
  2832.                    01h Out of storage or handles
  2833.                    02h Temporary error (such as locked region in
  2834.                        file) that can be expected to end)
  2835.                    03h Authorization problem
  2836.                    04h Internal error in system software
  2837.                    05h Hardware failure
  2838.                    06h System software failure (such as missing
  2839.                        configuration files)
  2840.                    07h Application program error
  2841.                    08h File or item not found
  2842.                    09h File or item of invalid type or format
  2843.                    0Ah File or item locked
  2844.                    0Bh Wrong disk in drive, bad spot on disk, or
  2845.                        storage medium problem
  2846.                    0Ch Unknown error
  2847.               BL=Recommended action...
  2848.                    01h Retry reasonable number of times, then prompt
  2849.                        user to select abort or ignore
  2850.                    02h Retry reasonable number of times with delay
  2851.                        between retries, then prompt user to select
  2852.                        abort or ignore
  2853.                    03h Get corrected information from user caused by
  2854.                        incorrect filename or drive specification
  2855.                    04h Abort application and by terminating the
  2856.                        program, releasing locks, closing files,...
  2857.                    05h Abort application.
  2858.                    06h Ignore error
  2859.                    07h Retry after user intervention to remove cause
  2860.                        of error
  2861.               CH=Error locus...
  2862.                    01h Unknown
  2863.                    02h Block device
  2864.                    03h Network
  2865.                    04h Serial device
  2866.                    05h Memory
  2867.               ES:DI=ASCIIZ volume label of disk to insert, if
  2868.                    AX=0022h (invalid disk change)
  2869.  ----------------------------------------------------------------------
  2870.  Get Interrupt Vector
  2871.    Call with: AX=3500h
  2872.               AL=Interrupt number
  2873.    Returns  : ES:BX=segment:offset of interrupt handler
  2874.  ----------------------------------------------------------------------
  2875.  Get DOS Version Number
  2876.    Call with: AX=3000h
  2877.    Returns  : AL=Major version number
  2878.               AH=Minor version number
  2879.  ----------------------------------------------------------------------
  2880.  Get Program Segment Prefix (PSP) Address
  2881.    Call with: AX=6200h
  2882.    Returns  : BX=Segment address of PSP
  2883.  ----------------------------------------------------------------------
  2884.  Get Return Code
  2885.    Call with: AX=4D00h
  2886.    Returns  : AH=00h if normal termination by Int 20h, Int 21h
  2887.                    Function 0, or Int 21h Function 4Ch
  2888.               AH=02h if termination by critical-error handler
  2889.               AH=03h if termination by Int 21h Function 31h or
  2890.                    Int 27h
  2891.               AL=Return code passed by child process...0 if child
  2892.                    terminated by Int 20h, Int 21h Function 00h, or
  2893.                    Int 27h
  2894.  ----------------------------------------------------------------------
  2895.  Get Time
  2896.    Call with: AX=2C00h
  2897.    Returns  : CH=Hour (0 through 23)
  2898.               CL=Minute (0 through 59)
  2899.               DH=Second (0 through 59)
  2900.               DL=Hundredths of a second (0 through 99)
  2901.  ----------------------------------------------------------------------
  2902.  Get Verify Flag
  2903.    Call with: AX=5400h
  2904.    Returns  : AL=00h if verify OFF
  2905.               AL=01h if verify ON
  2906.  ----------------------------------------------------------------------
  2907.  Get address of InDOS Flag
  2908.    Call with: AX=3400h
  2909.    Returns  : ES:BX=Address of InDos flag
  2910.  ----------------------------------------------------------------------
  2911.  Get or Set Allocation Strategy
  2912.    Call with: If getting strategy code
  2913.                 AX=5800h
  2914.               If setting strategy code
  2915.                 AX=5801h
  2916.                 BX=00h for First fit
  2917.                 BX=01h for Best fit
  2918.                 BX=02h for Last fit
  2919.    Returns  : If allocation strategy set or got
  2920.                 Carry flag=clear
  2921.                 AX=00h for First fit
  2922.                 AX=01h for Best fit
  2923.                 AX=02h for Last fit
  2924.               If not
  2925.                 Carry flag=set
  2926.                 AX=01h Error code
  2927.  ----------------------------------------------------------------------
  2928.  Get or Set Break Flag
  2929.    Call with: AX=3300h if getting Break flag status
  2930.               AX=3301h if setting Break flag status
  2931.    Returns  : If the Break flag is off DL=00h
  2932.               If the Break flag is on  DL=01h
  2933.               If setting Break flag returns nothing
  2934.  ----------------------------------------------------------------------
  2935.  Get or Set Code Page
  2936.    Call with: AX=6601h to get code page
  2937.               AX=6602h to select code page
  2938.               If AX=6602h
  2939.                 BX=Code page to select
  2940.    Returns  : If code page set or got
  2941.                 Carry flag=clear
  2942.                 If also called with AL=01h
  2943.                   BX=Active code page
  2944.                   DX=Default code page
  2945.               If not
  2946.                 Carry flag=set
  2947.                 AX=02h or 65h Error codes
  2948.  ----------------------------------------------------------------------
  2949.  Get or Set Country Information
  2950.    Call with: If getting internationalization information...
  2951.                 To get current country information
  2952.                   AX=3800h
  2953.                 To get information if country code < 255
  2954.                   AX=3801-38FEh
  2955.                 To get information if country code >= 255
  2956.                   AX=38FFh
  2957.                 BX=Country code if AL=FFh
  2958.                 DS:DX=segment:offset of buffer for returned info
  2959.               If setting current country code...
  2960.                 AX=3801-38FEh if country code < 255
  2961.                 AX=38FFh if country code >= 255
  2962.                 BX=Country code if AX=38FFh
  2963.                 DX=FFFFh
  2964.    Returns  : If getting internationalization information...
  2965.               If call successful
  2966.                 Carry flag=clear
  2967.                 BX=Country code
  2968.                 The buffer is filled in as follows:
  2969.                   Byte# 00h-01h=Date format...
  2970.                     Bit 0=USA month/day/year
  2971.                     Bit 1=Europe day/month/year
  2972.                     Bit 2=Japan year/month/day
  2973.                   Byte# 02h-06h=ASCIIZ currency symbol
  2974.                   Byte# 07h-08h=ASCIIZ thousands separator
  2975.                   Byte# 09h-0Ah=ASCIIZ decimal separator
  2976.                   Byte# 0Bh-0Ch=ASCIIZ date separator
  2977.                   Byte# 0Dh-0Eh=ASCIIZ time separator
  2978.                   Byte# 0Fh Currency format...
  2979.                     Bit 0=0 if currency value follows symbol
  2980.                     Bit 0=1 if currency symbol follows value
  2981.                     Bit 1=0 if no space between value and
  2982.                             currency symbol
  2983.                     Bit 1=1 if one space between value and
  2984.                             currency symbol
  2985.                     Bit 2=0 if currency symbol and decimal
  2986.                             are seperate
  2987.                     Bit 2=1 if currency symbol replaces
  2988.                             decimal seperator
  2989.                   Byte# 10h=Number of digits after decimal in
  2990.                               currency
  2991.                   Byte# 11h=Time format...
  2992.                     Bit 0=0 if 12-hour time
  2993.                     Bit 0=1 if 24-hour time
  2994.                   Byte# 12h-15h=Case-map call address
  2995.                   Byte# 16h-17h=ASCIIZ data-list separator
  2996.                   Byte# 18h-21h=Reserved
  2997.               If call unsuccessful
  2998.                 Carry flag is set
  2999.                 AX=0002h Error code
  3000.  ----------------------------------------------------------------------
  3001.  IOCTL (I/O control):
  3002.  *Get Device Information
  3003.               AX=4400h
  3004.               BX=Handle
  3005.               If function successful Carry flag: clear
  3006.               DX=Device information word for a file...
  3007.                    Bits 0-5 =drive number (0=A, 1=B,...)
  3008.                    Bit  6   =0 (file has been written)
  3009.                             =1 (file has not been written)
  3010.                    Bit  7   =0 (indicating a file)
  3011.                    Bits 8-15=0 (reserved)
  3012.                  Device information for a device...
  3013.                    Bit  0   =1 (if console input)
  3014.                    Bit  1   =1 (if console output)
  3015.                    Bit  2   =1 (if NUL device)
  3016.                    Bit  3   =1 (if clock device)
  3017.                    Bit  4   =reserved
  3018.                    Bit  5   =0 (if handle in ASCII mode)
  3019.                             =1 (if handle in binary mode)
  3020.                    Bit  6   =0 (if end of file on input)
  3021.                    Bit  7   =1 (indicating a device)
  3022.                    Bits 8-13=reserved
  3023.                    Bit 14   =1 (if device supports IOCTL Read
  3024.                                and  Write Control Data subfunctions)
  3025.                             =0 (if Control Data subfunctions not
  3026.                                supported)
  3027.                    Bit 15   =reserved
  3028.               If function unsuccessful
  3029.                 Carry flag: set
  3030.                 AX=Error code (01h, 05h, or 06h)
  3031.  *Change Sharing Retry Count
  3032.    Call with: AX=440Bh
  3033.               CX=Delays per retry (default=1)
  3034.               DX=Number of retries (default=3)
  3035.    Returns  : If function successful
  3036.                 Carry flag: clear
  3037.               If function unsuccessful
  3038.                 Carry flag: set
  3039.                 AX=Error code (01h)
  3040.  *Check Input Status
  3041.    Call with: AX=4406h
  3042.               BX=Handle
  3043.    Returns  : If function successful
  3044.                 Carry flag: clear
  3045.               And for a device
  3046.                 AL=00h (if device not ready)
  3047.                   =FFh (if device ready)
  3048.               Or for a file
  3049.                 AL=00h (if file pointer at EOF)
  3050.                   =FFh (if file pointer not at EOF)
  3051.               If function unsuccessful
  3052.                 Carry flag: set
  3053.                 AX=Error code (01h, 05h, 06h,or 0Dh)
  3054.  *Check Output Status
  3055.    Call with: AX=4407h
  3056.               BX=Handle
  3057.    Returns  : If function successful
  3058.                 Carry flag: clear
  3059.               And for a device
  3060.                 AL=00h (if device not ready)
  3061.                   =FFh (if device ready)
  3062.               Or for a file
  3063.                 AL=FFh
  3064.               If function unsuccessful
  3065.                 Carry flag: set
  3066.                 AX=Error code (01h, 05h, 06h,or 0Dh)
  3067.  *Check if Block Device is Remote
  3068.    Call with: AX=4409h
  3069.               BX=Drive number (0=default, 1=A, 2=B,...)
  3070.    Returns  : If function successful
  3071.                 Carry flag: clear
  3072.                 DX=Device attribute word
  3073.                      Bit 12=0 (if drive is local)
  3074.                            =1 (if drive is remote)
  3075.               If function unsuccessful
  3076.                 Carry flag: set
  3077.                 AX=Error code (01h or 0Fh)
  3078.  *Check if Block Device is Removable
  3079.    Call with: AX=4408h
  3080.               BX=Drive number (0=default, 1=A, 2=B,...)
  3081.    Returns  : If function successful
  3082.                 Carry flag: clear
  3083.                 AL=00h (if medium is removable)
  3084.                   =01h (if medium is not removable)
  3085.               If function unsuccessful
  3086.                 Carry flag: set
  3087.                 AX=Error code (01h or 0Fh)
  3088.  *Check if Handle is Remote
  3089.    Call with: AX=440Ah
  3090.               BX=Handle
  3091.    Returns  : If function successful
  3092.                 Carry flag: clear
  3093.                 DX=Attribute word for file or device
  3094.                      Bit 15=0 (if local)
  3095.                            =1 (if remote)
  3096.               If function unsuccessful
  3097.                 Carry flag: set
  3098.                 AX=Error code (01h or 06h)
  3099.  *Generic I/O Control for Block Devices
  3100.    Call with: AX=440Dh
  3101.               BX=Drive code (0=default, 1=A, 2=B,...)
  3102.               CX=Minor function code...
  3103.                    0840h=Set Device Parameters
  3104.                    0841h=Write Track
  3105.                    0842h=Format and Verify Track
  3106.                    0846h=Set Media ID (4.0+)
  3107.                    0847h=Set Access Flag
  3108.                    0860h=Get Device Parameters
  3109.                    0861h=Read Track
  3110.                    0862h=Verify Track
  3111.                    0866h=Get Media ID (4.0+)
  3112.                    0867h=Get Access Flag
  3113.               DS:DX=segment:offset of parameter block
  3114.    Returns  : If function successful...
  3115.                 Carry flag: clear
  3116.               ...and if called with CL=60h or 61h
  3117.                 DS:DX=segment:offset of parameter block
  3118.               If function unsuccessful
  3119.                 Carry flag: set
  3120.                 AX=Error code (01h or 02h)
  3121.  *Generic I/O Control for Character Devices
  3122.    Call with: AX=440Ch
  3123.               BX=Handle
  3124.               CH=Category (major) code:
  3125.                    00=Unknown
  3126.                    01=COM1, COM2, COM3, or COM4
  3127.                    03=CON (keyboard and display)
  3128.                    05=LPT1, LPT2, or LPT3
  3129.               CL=Function (minor) code:
  3130.                    45h=Set Iteration Count
  3131.                    4AH=Select Code Page
  3132.                    4CH=Start Code Page Preparation
  3133.                    4DH=End Code Page Preparation
  3134.                    5Fh=Set Display Information [Version 4.0]
  3135.                    65h=Get Iteration Count
  3136.                    6AH=Query Selected Code Page
  3137.                    6BH=Query Prepare List
  3138.                    7Fh=Get Display Information [Version 4.0]
  3139.               DS:DX=segment:offset of parameter block
  3140.    Returns  : If function successful
  3141.                 Carry flag: clear
  3142.               And if called with CL=65h, 6Ah, or 6Bh
  3143.                 DS:DX=segment:offset of parameter block
  3144.               If function unsuccessful
  3145.                 Carry flag: set
  3146.                 AX=Error code (01h)
  3147.  *Get Logical Drive Map
  3148.    Call with: AX=440Eh
  3149.               BX=Drive code (0=default, 1=A, 2=B,...)
  3150.    Returns  : If function successful
  3151.                 Carry flag: clear
  3152.                 AL=Mapping code
  3153.                   =00h (if only one logical drive code assigned to
  3154.                      the block device) ...)
  3155.                   =01h-1Ah (logical drive code (1=A, 2=B,...)
  3156.                      mapped to the block device)
  3157.               If function unsuccessful
  3158.                 Carry flag: set
  3159.                 AX=Error code (01h or 05h)
  3160.  *Read Control Data from Block Device Driver
  3161.    Call with: AX=4404h
  3162.               BX=Drive code (0=default, 1=A, 2=B,...)
  3163.               CX=Number of bytes to read
  3164.               DS:DX=segment:offset of buffer
  3165.    Returns  : If function successful
  3166.                 Carry flag: clear
  3167.                 AX=Bytes transferred
  3168.               If function unsuccessful
  3169.                 Carry flag: set
  3170.                 AX=Error code (01h, 05h, 06h,or 0Dh)
  3171.  *Read Control Data from Character Device Driver
  3172.    Call with: AX=4402h
  3173.               BX=Handle
  3174.               CX=Number of bytes to read
  3175.               DS:DX=segment:offset of buffer
  3176.    Returns  : If function successful
  3177.                 Carry flag: clear
  3178.                 AX=Bytes read and
  3179.               If function unsuccessful
  3180.                 Carry flag: set
  3181.                 AX=Error code (01h, 05h, 06h, or 0Dh)
  3182.  *Set Device Information
  3183.               AX=4401h
  3184.               BX=Handle
  3185.               DX=Device information word
  3186.                    Bit 0    =1 (if console input)
  3187.                    Bit 1    =1 (if console output)
  3188.                    Bit 2    =1 (if NUL device)
  3189.                    Bit 3    =1 (if clock device)
  3190.                    Bit 4    =0 (reserved)
  3191.                    Bit 5    =0 (to select ASCII mode)
  3192.                             =1 (to select binary mode)
  3193.                    Bit 6    =0 (reserved)
  3194.                    Bit 7    =1 (indicating a device)
  3195.                    Bits 8-15=0 (reserved)
  3196.      Returns: If function successful Carry flag: clear
  3197.               If function unsuccessful
  3198.                 Carry flag: set
  3199.               AX=Error code (01h, 05h, or 06h)
  3200.  *Set Logical Drive Map
  3201.    Call with: AX=440Fh
  3202.               BX=Drive code (0=default, 1=A, 2=B,...)
  3203.    Returns  : If function successful
  3204.                 Carry flag: clear
  3205.                 AL=Mapping code
  3206.                   =00h (if only one logical drive code assigned
  3207.                      to the block device)
  3208.                   =01h-1Ah (logical drive code (1=A, 2=B,...)
  3209.                      mapped to the block device)
  3210.               If function unsuccessful
  3211.                 Carry flag: set
  3212.                 AX=Error code (01h or 05h)
  3213.  *Write Control Data to Block Device Driver
  3214.    Call with: AX=4405h
  3215.               BX=Drive code (0=default, 1=A, 2=B,...)
  3216.               CX=Number of bytes to write
  3217.               DS:DX=segment:offset of data
  3218.    Returns  : If function successful
  3219.                 Carry flag: clear
  3220.                 AX=Bytes transferred
  3221.               If function unsuccessful
  3222.                 Carry flag: set
  3223.                 AX=Error code (01h, 05h, 06h,or 0Dh)
  3224.  *Write Control Data to Character Device Driver
  3225.    Call with: AX=4403h
  3226.               BX=Handle
  3227.               CX=Number of bytes to write
  3228.               DS:DX=segment:offset of data
  3229.    Returns  : If function successful
  3230.                 Carry flag: clear
  3231.                 AX=Bytes transferred
  3232.               If function unsuccessful
  3233.                 Carry flag: set
  3234.                 AX=Error code (01h, 05h, 06h, or 0Dh)
  3235.  ----------------------------------------------------------------------
  3236.  Memory, Allocate block
  3237.    Call with: AX=4800h
  3238.               BX=Number of paragraphs of memory needed
  3239.    Returns  : If memory allocated
  3240.                 Carry flag=clear
  3241.                 AX=Initial segment of allocated block
  3242.               If not
  3243.                 Carry flag=set
  3244.                 AX=07h or 08h Error code
  3245.                 BX=Size of largest available block (paragraphs)
  3246.  ----------------------------------------------------------------------
  3247.  Memory, Release block
  3248.    Call with: AX=4900h
  3249.               ES=Segment of block to be released
  3250.    Returns  : If memory released Carry flag=clear
  3251.               If not
  3252.                 Carry flag=set
  3253.                 AX=07h or 09h Error code
  3254.  ----------------------------------------------------------------------
  3255.  Memory, Resize block
  3256.    Call with: AX=4A00h
  3257.               BX=Desired new block size in paragraphs
  3258.               ES=Segment of block to be modified
  3259.    Returns  : If memory resized Carry flag=clear
  3260.               If not
  3261.                 AX =07, 08h, or 09h Error code
  3262.                 BX=Maximum block size available (paragraphs)
  3263.  ----------------------------------------------------------------------
  3264.  Multiplex (Interrupt 2Fh)
  3265.    Call with: AH=01h Print Spooler
  3266.               AH=06h Resident ASSIGN command
  3267.               AH=10h Resident SHARE command
  3268.               AH=B7h Resident APPEND command
  3269.               AL=Function number
  3270.    Returns  : If on input AL was equal to 0, AL will equal 0FFh upon
  3271.               return. Otherwise it will depend on the handler
  3272.  ----------------------------------------------------------------------
  3273.  Printer Output
  3274.    Call with: AX=0500h
  3275.               DL=ASCII code for character
  3276.  ----------------------------------------------------------------------
  3277.  Redirect Handle
  3278.    Call with: AX=4600h
  3279.               BX=Handle for file or device
  3280.               CX=Handle to be redirected
  3281.    Returns  : If handle redirected Carry flag=clear
  3282.               If not AX=04h or 06h Error code
  3283.  ----------------------------------------------------------------------
  3284.  Set Data Transfer Area (DTA) Address
  3285.    Call with: AX=1A00h
  3286.               DS:DX=segment:offset of disk transfer area
  3287.  ----------------------------------------------------------------------
  3288.  Set Date
  3289.    Call with: AX=2B00h
  3290.               CX=Year (1980 through 2099)
  3291.               DH=Month (1 through 12)
  3292.               DL=Day (1 through 31)
  3293.    Returns  : If the date was set AL=00h
  3294.               If the date was not set AL=FFh
  3295.  ----------------------------------------------------------------------
  3296.  Set Extended Error Information
  3297.    Call with: Assumes previous call to function 5900h
  3298.               AX=5D0Ah
  3299.               DS:DX=segment:offset of structure
  3300.  ----------------------------------------------------------------------
  3301.  Set Interrupt Vector
  3302.    Call with: AH=25h
  3303.               AL=Interrupt number
  3304.               DS:DX=segment:offset of interrupt handling routine
  3305.  ----------------------------------------------------------------------
  3306.  Set Program Segment Prefix (PSP) Address
  3307.    Call with: AX=5000h
  3308.               BX=New PSP segment address
  3309.  ----------------------------------------------------------------------
  3310.  Set Time
  3311.    Call with: AX=2D00h
  3312.               CH=Hour (0 through 23)
  3313.               CL=Minute (0 through 59)
  3314.               DH=Second (0 through 59)
  3315.               DL=Hundredths of a second (0 through 99)
  3316.    Returns  : If the time was set AL=00h
  3317.               If the time was not set AL=FFh
  3318.  ----------------------------------------------------------------------
  3319.  Set Verify Flag
  3320.    Call with: AH=2E00h
  3321.  ----------------------------------------------------------------------
  3322.  Terminate Program:
  3323.    Call with: AX=0000h
  3324.               CS=Segment address of program segment prefix
  3325.  ----------------------------------------------------------------------
  3326.  Terminate Program with Return Code
  3327.    Call with: AH=4Ch
  3328.               AL=Return code
  3329.  ----------------------------------------------------------------------
  3330.  Terminate and Stay Resident
  3331.    Call with: AH=31h
  3332.               AL=Return code (0 through 255)
  3333.               DX=Number of paragraphs to reserve in memory
  3334. ╔═════════════════════════════════════════════════════════════════════╗
  3335. ║ List of DOS Extended Error Codes                                    ║
  3336. ╚═════════════════════════════════════════════════════════════════════╝
  3337.  Value...  Meaning...
  3338.  01h       Function number invalid
  3339.  02h       File not found
  3340.  03h       Path not found
  3341.  04h       Too many open files
  3342.  05h       Access denied
  3343.  06h       Handle invalid
  3344.  07h       Memory control blocks destroyed
  3345.  08h       Insufficient memory
  3346.  09h       Memory block address invalid
  3347.  0Ah       Environment invalid
  3348.  0Bh       Format invalid
  3349.  0Ch       Access code invalid
  3350.  0Dh       Data invalid
  3351.  0Eh       Unknown unit
  3352.  0Fh       Disk drive invalid
  3353.  10h       Attempted to remove current directory
  3354.  11h       Not same device
  3355.  12h       No more files
  3356.  13h       Disk write-protected
  3357.  14h       Unknown unit
  3358.  15h       Drive not ready
  3359.  16h       Unknown command
  3360.  17h       Data error (CRC)
  3361.  18h       Bad request structure length
  3362.  19h       Seek error
  3363.  1Ah       Unknown media type
  3364.  1Bh       Sector not found
  3365.  1Ch       Printer out of paper
  3366.  1Dh       Write fault
  3367.  1Eh       Read fault
  3368.  1Fh       General failure
  3369.  20h       Sharing violation
  3370.  21h       Lock violation
  3371.  22h       Disk change invalid
  3372.  23h       FCB unavailable
  3373.  24h       Sharing buffer exceeded
  3374.  25h       Code page mismatched
  3375.  26h       end of file operation not completed
  3376.  27h       Disk full
  3377.  28h-31h   Reserved
  3378.  32h       Unsupported network request
  3379.  33h       Remote machine not listening
  3380.  34h       Duplicate name on network
  3381.  35h       Network name not found
  3382.  36h       Network busy
  3383.  37h       Device no longer exists on network
  3384.  38h       Network command limit exceeded
  3385.  39h       Error in network adapter hardware
  3386.  3Ah       Incorrect response from network
  3387.  3Bh       Unexpected network error
  3388.  3Ch       Remote adapter incompatible
  3389.  3Dh       Print queue full
  3390.  3Eh       Not enough room for print file
  3391.  3Fh       Print file was deleted
  3392.  40h       Network name deleted
  3393.  41h       Network access denied
  3394.  42h       Incorrect network device type
  3395.  43h       Network name not found
  3396.  44h       Network name limit exceeded
  3397.  45h       Network session limit exceeded
  3398.  46h       Temporary pause
  3399.  47h       Network requested not accepted
  3400.  48h       Print or disk redirection paused
  3401.  49h-4Fh   Reserved
  3402.  50h       File already exists
  3403.  51h       Duplicate FCB
  3404.  52h       Cannot make directory
  3405.  53h       Fail on Int 24H (critical error)
  3406.  54h       Too many redirections
  3407.  55h       Duplicate redirection
  3408.  56h       Invalid password
  3409.  57h       Invalid parameter
  3410.  58h       Network write error
  3411.  59h       Function not supported by network
  3412.  5Ah       Required system component not installed
  3413.  65h       Device not selected
  3414. ╔═════════════════════════════════════════════════════════════════════╗
  3415. ║ Using the XYZ Critical Error Handler                                ║
  3416. ╚═════════════════════════════════════════════════════════════════════╝
  3417.  If you were to try and copy  a file from your hard disk to  a floppy,
  3418.  and there was no floppy disk in the drive bay, the copy program could
  3419.  not continue because it cannot copy  a file to an empty drive.   This
  3420.  would be  an example  of a  critical error.  Other examples would be:
  3421.    Attempting to write a file to a write-protected disk,
  3422.    A disk sector is unreadable,
  3423.    Attempting to read or write to an unformatted disk,
  3424.    The printer is out of paper, and so on.
  3425.  Anything listed  in the  section titled  "List of  DOS extended error
  3426.  codes" would  also be  a good  example.   Anyways, the  program would
  3427.  have to stop the current task  until something is done to enable  the
  3428.  task  to  be  continued.   Usually,  DOS  will print out the infamous
  3429.  "Abort,  Retry,  or  Fail?"  to  the  current  cursor location on the
  3430.  screen. If  you have  already gone  to great  lengths to  draw pretty
  3431.  screen graphics, then DOS will  write "Abort, Retry, or Fail?"  right
  3432.  in the  middle of  all of  it!   Wouldn't it  be better  if you could
  3433.  intercept DOS's improper attempt  at correcting a critical  error and
  3434.  replace it  with one  of your  own? You  can, with  the XYZ  critical
  3435.  error handler!  But how does it work?
  3436.  
  3437.  To enable  the XYZ  Critical Error  Handler, all  you need  to do  is
  3438.  include  one  label  in  your  coding.  That  label  should be called
  3439.  "CriticalError". Somewhere underneath that label, you must include  a
  3440.  "ret" command, since DOS is in an unstable state after responding  to
  3441.  a critical error and is waiting for a response from you as to what to
  3442.  do, so you must return to the DOS handler.
  3443.  
  3444.  When  a  critical  error  occurs,  the reserved argument "error" will
  3445.  contain one of the error codes listed in the section titled "List  of
  3446.  DOS extended error codes".  This code will give  you an idea of  what
  3447.  happened and  how you  might possibly  respond to  it. There  are two
  3448.  things to  remember when  responding to  a critical  error. One is to
  3449.  inform  the  user  of  the  error  and  how  to  possibly correct the
  3450.  situation, i.e. -- "There is no  disk in drive A:, please insert  the
  3451.  disk now. Press 'Enter'  when you are ready."  Two, you must use  the
  3452.  command "set error=" to inform the system of your decision of how  to
  3453.  handle the critical error. If error is set to...
  3454.  
  3455.    0...then the system will act like no error occurred and return 
  3456.        control to the program 
  3457.    1...then the system will keep retrying
  3458.    2...then the system will terminate the program
  3459.    3...then the system will act like error occurred but return 
  3460.       control to program anyways.
  3461.  
  3462.  If  you  respond  with  an  incorrect  decision  (i.e. -- the program
  3463.  cannot continue if the error is not corrected or if the error  cannot
  3464.  be corrected as in a divide by zero or dos internal error), then  the
  3465.  critical error  will keep  returning to  your critical  error handler
  3466.  until  the  situation  is  resolved  or  you terminate the program by
  3467.  setting error=2.
  3468.  
  3469.  For example:
  3470.  
  3471.    000 Example of Critical Error Handling
  3472.    dat txt 15 filename=a:\xyz.zip
  3473.    dat txt ErrorMessage=I can't read from drive a...
  3474.    set color=0A 00 00
  3475.    set start=1
  3476.    set size=28
  3477.    set mode=0
  3478.    file open filename
  3479.    jer Quit
  3480.    tty filename
  3481.    --- Quit
  3482.    file close handle
  3483.    end with 1
  3484.    --- CriticalError
  3485.    set color=0C 00 00
  3486.    set error=3 Informs system to act like an error occured
  3487.    tty ErrorMessage
  3488.    ret
  3489.    eof
  3490.  
  3491.  Now if the disk  is not present when  this program tries to  open the
  3492.  file on  drive a,  then the  program will  automatically jump  to the
  3493.  "CriticalError" section and  display the message  "I can't read  from
  3494.  drive  a..."  before  quitting.  Otherwise  this program will display
  3495.  "a:\xyz.zip" and quit.